Search Unity

Animation changes object position

Discussion in 'Animation' started by Josiah_Ironclad, Nov 29, 2019.

  1. Josiah_Ironclad

    Josiah_Ironclad

    Joined:
    Sep 24, 2019
    Posts:
    156
    I got an ultra simple animation of a sword that just tilts 90 degrees down and back up (placeholder swinging animation). Problem is, whenever the animation plays, the transform of the object gets set to whatever the position was in Blender.

    The sword is a child of the player object, and it's positioned very specificly (but also temporarily). If the model was centered in Blender, the sword will teleport inside the player so that its local coords are "0, 0, 0".

    The animator component doesn't have "Apply Root Motion" checked.

    Currently the Blender file is physically centered, but the "center" of the model is slightly lower, so that I can rotate the sword by the hilt rather than by the center of its volume. This causes the sword to teleport way up in the air when the animation plays, and back down to its original location when the current animation state isn't the one with the swing animation.
     
    Last edited: Nov 29, 2019