Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

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

  1. IndubhushanDas

    IndubhushanDas

    Joined:
    Feb 19, 2014
    Posts:
    110
    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. IndubhushanDas

    IndubhushanDas

    Joined:
    Feb 19, 2014
    Posts:
    110
    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.
unityunity