Search Unity

how to change the object's animation according to its position

Discussion in 'Animation' started by carlosdaniel369, Nov 6, 2019.

  1. carlosdaniel369

    carlosdaniel369

    Joined:
    Nov 6, 2019
    Posts:
    3
    I have a 2d object that is falling. when I get to the middle of the screen, I want him to change his animation automatically. how to do this?
     
  2. Imperial-Dynamics

    Imperial-Dynamics

    Joined:
    Oct 18, 2019
    Posts:
    17
    Hello. the easy way is to create 2 clips. one for jump and one for fall. when you press jump play the jump animation and then check velocity and see if velocity is negative play the falling animation.