Object not moving after changing animator parameter

Hello!

I’m having problems with animations and animators in my 2d project, because i can’t move an object after changing animation, by changing a parameter in the animator.

This is what i want to do:

  1. Animate the object to go up and down in the air
  2. Receive input
  3. Change the current animation (sprite going up and down) to another animation that only changes the sprite of that object and switch physics on on that object

This is how trying to do it:

  1. Create two animations (one that makes the object go up and down, that changes the position property of the object, and another one that only changes the sprite of the object, that only changes the sprite property)
  2. Make the animation that goes up and down the default animation
  3. Make a transition from the default animation to the animation, that only changes the sprite, that is triggered once a boolean parameter on the animator is set to true
  4. Set the paremeter to true to trigger the second animation
  5. Turn off “Is Kinemetic” (so that it can be affected by gravity and other forces)

This is what’s happening:

  1. The object goes up and down using the first animation
  2. Input is received
  3. The second animation starts playing (changing the sprite of the object) but the object does not move (it stays in the air and it is not affected by gravity or other forces, even though the “Is Kinemetic” is turned off)

This only happens when the second animation changes the position property of the object, so i would like to know why this is happening and/or how i can fix this.
Thank you for reading this.

I know this tread is old, but i cant find any information for Unity 4.x how to use this, but i figured out, that you can use animation layers for 2d objects as well, and that do the trick.

So how i do it:
Create a new layer for second animation, set weight to 1, blending override. Move animation state that only change the sprite to new layer, make transition from Any state to this animation. Set transition condition to use trigger (or boolean) animation parameter. You might also need another animation state for idle (with default sprite).

Hope it might help someone.