Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Neikke on April 10, 2019, 02:52:58 AM

Title: How to reset animation to starting point?
Post by: Neikke on April 10, 2019, 02:52:58 AM
Hi,

I have a very simple falling rock animation on a platform that spawns from time to time in my endless runner. Rock prefab has two states “Static” - where rock does nothing, and “Falling” where the simple falling animation is played. Also I have a 2D collider attached on the rock for detecting a player approaching etc.

The problem is that sometimes when I approach that platform - the rock is already lying on the ground which means it was stuck on “Falling” animation and didn’t reset to initial “Static” animation. Though I set it to finish Falling animation and return to Waiting for collision with player to occur.

Cracking my head to solve this really.. any ideas what can cause this?
Title: Re: How to reset animation to starting point?
Post by: Thore on April 10, 2019, 04:44:01 AM
When it happens sometimes, it looks like a bug, especially in an endless runner type of game. Can you de- and reactivate the object when it is off screen and reset it then? Otherwise use mechanim, and a set animation trigger action to return to a state you want. You can hook up the resting state to any state, and reset it that way.
Title: Re: How to reset animation to starting point?
Post by: Neikke on April 11, 2019, 02:28:22 AM
 :(

Thanks but, it's still misty for me..