+2 votes

Stop sprite animation based end point Path2d>PathFollow2D
How can i detect my sprite reached the destined Path2D (not a loop, it has an end point). once my sprite reachs the destination point i need to stop my sprite animation.How can i detect if my sprite reached the last/destination point?

Thanks
B

in Engine by (14 points)

1 Answer

0 votes

If you animate your PathFollow2D's offset with an AnimationPlayer, you can set the AnimatedSprite's playing property to false at the end of your animation. Otherwise, you could check for the PathFollow2D's unit_offset being 1.0 in _process and then stopping the animation manually.

by (698 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.