class_name Bullet extends Area2D var speed = 750 signal hit(bullet, body) func setSpeed(value): speed = value #animation func _physics_process(delta: float) -> void: position += transform.x * speed * delta func _on_body_entered(body: Node2D) -> void: print("bullet collision") hit.emit(self, body)