Search Unity

Blend animation

Discussion in 'Animation' started by JimAllehop, Nov 21, 2014.

  1. JimAllehop

    JimAllehop

    Joined:
    Jun 10, 2014
    Posts:
    5
    Hello Unity community,

    I have a problem that i can't solve. I wanted to know if someone could give me a tips.

    The situation :

    My object have 4 animations put in animator : Idle, Left, Right, Shoot.

    (cf. screenshot "Animator")

    All animations are launched with gui button script. Boolean fot the movement, and trigger for the shoot.

    From Idle to left, Left to idle, Idle to right, Right to idle; no problem all animations blend correctly.

    But if i want to shoot and turn during the shoot, my object finish the animation of shooting and only after he launch the animation of movement left or right.

    I don't understand how to resolve this problem.
    Did i need to take a look at the blend tree ?

    Thank a lot,
     

    Attached Files:

  2. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    There are a number of ways you could do this. 1 way would be to add in Shoot turn animations and states. Another way would be to mask off the lower body of the shoot animation, and have this trigger from any state, on another layer inside the Animator Controller. So, if you turn, and shoot, the upper body plays the shoot animation, and the lower body does the turn animation.
     
    theANMATOR2b likes this.
  3. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
  4. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    Yes, but you can create your own condition. For instance, the animation could trigger from a keyboard key, but their needs to be a transition created for this. In your Animator Controller, you can only shoot from the idle animation. You just need to make transition from the Right and Left states to the Shoot state.

    Like this:
     
    Last edited: Nov 22, 2014
    rakkarage likes this.
  5. JimAllehop

    JimAllehop

    Joined:
    Jun 10, 2014
    Posts:
    5
    Thank a lot Medhue, that's work !