Search Unity

Feet sliding in game--not in animator preview.

Discussion in 'Animation' started by GuruRamen, Nov 3, 2014.

  1. GuruRamen

    GuruRamen

    Joined:
    Jan 15, 2014
    Posts:
    13
    Hi folks,

    Wondering if someone might know what's causing the following behavior.

    I have a (Mecanim) character moving between a standing idle and a crouched idle. If I preview the transition in the animator/inspector the feet do not slide (WRT the grid). In game, triggering the same transition results in a a slightly different animation in which the feet do slide.

    I've put together this video to illustrate the difference.

    Other notes:
    1. Foot IK is checked on the pre and post-transition animator states.
    2. No code is run in OnAnimatorIK during this transition.
    3. This is inside V4.3.4f1, pro license.
    Finally, the screen caps below show the import settings for idle and crouchIdle animations. Changing "Based Upon" for root transform Y doesn't seem to affect the result.

    Thanks in advance!

    Dan

    Settings for crouch...
    upload_2014-11-2_19-36-18.png

    Settings for Idle...
    upload_2014-11-2_19-36-18.png
     

    Attached Files:

  2. GuruRamen

    GuruRamen

    Joined:
    Jan 15, 2014
    Posts:
    13
    For future searchers...

    Looks like I found a solution.

    Turning off Bake Into Pose for Root Transform (XZ) and selecting Original for "Based Upon". Not sure if the latter has any effect when baking is turned off.

    Dan
     
    theANMATOR2b likes this.
  3. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi Guru,

    you got it, in this case you want to keep the XZ animation, changing Based Upon has no effect when Bake Into Pose is not checked.
     
  4. GuruRamen

    GuruRamen

    Joined:
    Jan 15, 2014
    Posts:
    13
    Got it. Thanks a ton!