You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Gridmap/scripts/Instance3D.gd

15 lines
360 B

extends CharacterBody3D
const SPEED = 10.0
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):
var tween = get_tree().create_tween()
tween.tween_property(self, "position", new_position, 1/SPEED).set_trans(Tween.TRANS_SINE)
pass