Search Unity

player animation plays above the floor, help needed

Discussion in 'Editor & General Support' started by enzoravo, Oct 2, 2017.

  1. enzoravo

    enzoravo

    Joined:
    Jun 25, 2013
    Posts:
    284
    hello, i'm working on a game and i'm using some mixamo animations.

    i need that my player to roll on the floor to avoid some obstacles, i'm using the mixamo animation to let my 3d model do this, also i'm using root motion.

    when i try the animation on the test scene it works fine, it rolls on the floor like it suposed to be.

    but when i apply the animation to the character, using a capsule collider and i trigger the animation with a key or a button (i know this can't affect the animation) the animation plays just fine too, but a little bit above the floor and it looks weird, because seems like the player is rolling in the air.

    i think this happend for the capsule collider, because it keeps the player at certain distance from the floor and that's why the animation can't play in the right way.

    is there a way to avoid this or a workaround to let this work in the right way?

    thanks in advance for all the help.
     
  2. enzoravo

    enzoravo

    Joined:
    Jun 25, 2013
    Posts:
    284
    sorry i forgot to put a picture of the problem, here is one, you can see the model doing the roll above the floor.

     
  3. enzoravo

    enzoravo

    Joined:
    Jun 25, 2013
    Posts:
    284
    hello again, i found the cause of the problem

    i have removed the rigidbody from the player's gameobject, now the animation will play in the right way.

    the problem is, that i'm using the rigidbody to apply velocity to it to let the player move around the world.

    any idea on a workaround for this ?
     
    Last edited: Oct 4, 2017
  4. enzoravo

    enzoravo

    Joined:
    Jun 25, 2013
    Posts:
    284
    new info about this issue, if i keep the rigid body and i check IsKinematic the animation will play fine too, the problem is, without rigidbody or with the kinematic rigidbody i can't move the player using the velocity and can't detect collisions.

    i'm stuck here, any help or tip will be very useful.

    thanks in advance for the jhelp.
     
  5. KashewSucksAtCoding

    KashewSucksAtCoding

    Joined:
    Jun 20, 2020
    Posts:
    1
    Do you know the problem, I have the same problem.