extends CharacterBody3D var id = -1 func connect_to_world(id): var world_entity = Global.world.entities[id] world_entity.moving.connect(_on_entity_moving) pass func _on_entity_moving(new_position, speed): var tween = get_tree().create_tween() tween.tween_property(self, "position", new_position, 1.0/speed) pass