Search Unity

Die animation plays around 1f higher on Y axis than required

Discussion in 'Animation' started by IvanDonets, Dec 2, 2017.

  1. IvanDonets

    IvanDonets

    Joined:
    Feb 19, 2014
    Posts:
    117
    When I kill trolls, they play animation "Death", but it is not played properly. In animation tab, I chose death animation, pressed 'record' and changed enemy gameobject to be around 1f lower, but that still doesn't help.

    This problem arose after I switched from Legacy animation to Animator. In legacy format death animation played properly.

    I tried in script to change position of corpse (in end of death animation I set event "death anim played") :
    Code (CSharp):
    1.  Vector3 posi = gameObject.transform.position;
    2.  
    3.         posi.y = -1f;
    4.  
    5.         gameObject.transform.position = posi;
    but that still didn't work. So I had to turn off navmeshagent, and in rigidbody to disable y position freezing. But that still plays animation higher than expected ;-(

    can anyone help?

    here is a video of this bug:
     
  2. IvanDonets

    IvanDonets

    Joined:
    Feb 19, 2014
    Posts:
    117
    Oh, I solved the bug ;-)
    I just set Is Kinematic and increased mass of rigidbody, and it works just nicely ;-)
    never used those options before ...
     
    theANMATOR2b likes this.