Hello,
I am a newbie in godot, which I find fantastic !
I have succeed moving a sprite along a PathToFollow2D.
So, hierarchy of the node is: Path2D->PathToFollow2D->Sprite
I move the sprite from script of Path2D, and emit a signal when sprite has gone at the end:
func _process(delta):
if _run:
$PathFollow2D.set_offset($PathFollow2D.get_offset() + 200 * delta)
if $PathFollow2D.get_unit_offset() == 1.0:
_run = false
emit_signal("finished", _id, _currentPath)
I can launch as many of this node as I want, and set same curve to Path2D, so all sprite go the same way. Now, I would like to add collision detection, so all sprite line up at the end of the way. I have seen explanation about KinematicBody2D using move_and_collide, but none about following a path. Is KinematicBody not the right type ?
I could not find any example of this, so, if someone could give me an hint, that would be appreciated.
Thanks,
Claude