Search Unity

How to add transform in animator mecanim for character?

Discussion in 'Animation' started by DarkCooker, Mar 25, 2015.

  1. DarkCooker

    DarkCooker

    Joined:
    Jan 7, 2015
    Posts:
    119
    Hi All,

    I have bought a model from asset store with animation of walking and idle. (which is common)
    The animation is just "walking" and "idle" without transform of the character.

    I want to do a NPC on the map to "randomly" walk around or repeat walking around.

    So, I create a Animator Controller with two states:
    Idle (repeat) <---------> Walk(repeat)
    state transition by Exit time: 4 sec


    However, how can I add transform of X + Z and the rotation when it turns back?

    I try by adding an animation with loop by:
    AnimationWrapper
    ---> Model with Animator Controller
    And Animate the AnimationWrapper's transform.


    But the timing seems not accurate between Animator and Animation I added.
    The state transition time is not exactly 4 sec so my animation clip is difficult to match
    with the animator.

    What is the proper way to do such animation?

    Thanks very very much in advance,
    Billy