I found this out when making a game. if a animation is playing on one frame, and something triggers you to go to another frame, that animation will pause. and when you re-enter that frame, the animation will than continue to play where it left off. example, I made it so when an enemy touches you, it takes you to the game over screen. but when you go back to the game play (where the enemy is), instead of restarting, it takes you to where the enemy got you, and the enemy just hits you again. anyone know how to fix this?
you need a unload script.
in the load tab, set the y coordinate. every time you go in the frame, it will set the y coordinate to what you want.
1 Like
but how do i make it so that the animations restart from the beginning?
If your animation is a clip, you can use this:
/* load or default script */
CLIP.gotoAndPlay(1);
Replace CLIP with the name of the object that contains the animation
3 Likes
Yes, the current behavior is that. You have to do the restart in your code… I usually write a function that initializes everything before the user starts playing…
1 Like
can i try it?