Search Unity

Animator & Avatar mask

Discussion in 'Animation' started by Rabagast, Aug 5, 2016.

  1. Rabagast

    Rabagast

    Joined:
    Jan 30, 2013
    Posts:
    78
    Hi!

    I have a character with run animation and shoot animation. The shoot animation needs to blend into the run animation, so it can run and shoot at the same time.
    But I can't get it to work. Here is a small video clip of what I have done.
    I have changed the Avatar Mask to the Base Layer now. In the video is in the Shooting Layer which is wrong.



    I really need help with this. If someone could make me a tutorial I would be very grateful.
     
  2. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Your second layer is setup as an override layer with a mask that override everything except the right arm, this is exactly what we see on the video when you start to shoot.

    In this case you probably want an additive layer with a mask that affect only the upper body, also you will need to setup you shot animation as an additive motion to use it in this layer
    http://docs.unity3d.com/Manual/class-AnimationClip.html
    look at Additive Reference Pose.
    In the importer you can only choose a reference pose from the same Take, it can be outside of the animationc lip range but must be from the same take
    If you need more flexibility you need to use scripting which allow you to set a reference pose from any animation clip.
    http://docs.unity3d.com/ScriptReference/AnimationUtility.SetAdditiveReferencePose.html
     
    theANMATOR2b likes this.
  3. Rabagast

    Rabagast

    Joined:
    Jan 30, 2013
    Posts:
    78
    Hi!
    Thanks for the answer. I got it to work. I forgot to mark all the animations as Humanoid. :)