playMaker

Author Topic: How to reset animation to starting point?  (Read 1356 times)

Neikke

  • Full Member
  • ***
  • Posts: 134
How to reset animation to starting point?
« 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?
« Last Edit: April 10, 2019, 02:55:15 AM by Neikke »

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: How to reset animation to starting point?
« Reply #1 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.

Neikke

  • Full Member
  • ***
  • Posts: 134
Re: How to reset animation to starting point?
« Reply #2 on: April 11, 2019, 02:28:22 AM »
 :(

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