Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Blend Tree Dash Animation

Discussion in 'Animation' started by inferno46n2, Nov 15, 2021.

  1. inferno46n2

    inferno46n2

    Joined:
    Oct 29, 2020
    Posts:
    11
    Hey Guys,

    Quick question I am sure you guys can answer. I am quite new to Unity and I am just now taking a stab at the animator

    Currently my Animator is very basic and consists of three blend trees:
    1) Idle
    2) Running
    3) Dashing

    I have them all setup to play the animation relative to my mouse position (Top down 2D Shooter... think Enter the Gungeon Style...in fact I am using their sprites as placeholders)

    So far everything is working fine but I am having a problem with my Dashing blend tree. My Dash is set to go in the direction of my movement through a script (which is working fine), but my dash animation appears to be tied to my mouse position.

    That is problem 1. How can I make the animation play in the direction of movement rather than my mouse position?

    Problem 2 I am having, is as I am using a blend tree for the dashing animation, if I move my mouse during the animation, the animation changes relative to my mouse position. I do have the transition into the Dashing animation set to play full which is working fine, but the animation itself isn't behaving the way I want (movement direction)

    I'm wondering if I should be using some type of directional float parameter or something?

    here are some screen shots of my animator

    https://imgur.com/a/X7jH6jG

    EDIT:

    Fixed this myself by declaring new animation parameters within my dash script and using those for my blend tree
     
    Last edited: Nov 20, 2021
  2. KalOBrien

    KalOBrien

    Unity Technologies

    Joined:
    Apr 20, 2021
    Posts:
    89
    Could you share a gif or video of the behavior thats not wanted? Would be easier to see exactly what the issue is in this case.
     
  3. inferno46n2

    inferno46n2

    Joined:
    Oct 29, 2020
    Posts:
    11
    Thank you for the reply. Sorry I was busy with work but here is a gif of the issue. Notice how even if I move my mouse during that animation it rotates and plays frames from the other directions mid roll

    Notice if I aim the gun in the direction of the roll it looks fine but as soon as I aim in a different direction it changes my orientation

    I simply want the animation to play in my movement direction, and for it to fully complete before resuming


    https://imgur.com/a/0AsiBqb