Search Unity

Blend tree preview shows animation is running but in game view animation is not playing.

Discussion in 'Animation' started by hjnortje, Nov 20, 2019.

  1. hjnortje

    hjnortje

    Joined:
    Sep 1, 2018
    Posts:
    3
    I have setup a blend tree with walk forward, walk left, walk back and walk right.

    when I run the game and press "w" the player walks forward and animation is fine, same for backwards when pressing "s". When I press "w" + "a" the player moves a a 45 degree angle and the animation is fine, same with all other 45 degree animations, showing that the blend between forward and both horizontal movement works perfectly. but as soon as I walk just left or just right, the animation of the left and right lights up in the blend tree and it is moving in the preview like it should but in the game view my player is sliding left and right with no animation. Any Idea how to how to fix this? preview.jpg
     
  2. hjnortje

    hjnortje

    Joined:
    Sep 1, 2018
    Posts:
    3
    Found the problem in my code. The vertical zero position overridden the value of the bool that controlled the movement and set it to false. After removing the else statements and only set it to false when both axis are at zero the problem was solved.
     
    mfatihbarut likes this.