simple_bullet.gd 212 B

12345678910111213141516
  1. extends RigidDynamicBody3D
  2. const DESPAWN_TIME = 5
  3. var timer = 0
  4. func _ready():
  5. set_physics_process(true);
  6. func _physics_process(delta):
  7. timer += delta
  8. if timer > DESPAWN_TIME:
  9. queue_free()
  10. timer = 0