Search Unity

Want to move character along ground in a similar way to mecanim through script.

Discussion in 'Physics' started by Anders K R, Dec 12, 2014.

  1. Anders K R

    Anders K R

    Joined:
    Dec 6, 2012
    Posts:
    5
    I am using mecanim to control a character, but I want to be able to make him slide around from external forces. I want to make a script that uses animator.deltaPosition to move a character in addition to physics movement. I want to do it like this because applyRootMotion overrides x and z movement from my rigidbody.

    I have tried during OnAnimatorMove() to use the method rigidbody.MovePosition (rigidbody.position + animator.deltaPosition), but whilst it does work for flat movement and against walls, it makes the character not able to get up slopes properly (doesn't get properly on top of the slope and bounces away).