playMaker

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

Neikke

  • Full Member
  • ***
  • Posts: 128
    • View Profile
How to reset animation to starting point?
« on: April 09, 2019, 11:52:58 PM »
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 09, 2019, 11:55:15 PM by Neikke »

Thore

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
Re: How to reset animation to starting point?
« Reply #1 on: April 10, 2019, 01: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: 128
    • View Profile
Re: How to reset animation to starting point?
« Reply #2 on: April 10, 2019, 11:28:22 PM »
 :(

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