- Home /
animation changes weapon position?
As the title says, my gun's position move's to the right when it animates.
Not animating: Animating(moves to the right):
Shotgun's scale factor is 0.01, only applying one animation to it (idle). I can tell it acually moved because when I look at it not playing the game (with animation on) it's where I placed it but when I do press play it moves.
So set the import scale factor to 1 on everything - that often is the problem of importing stuff - then rearrange it and hopefully it won't move :)
Still move's to the right, think it could be something wrong when I exported it? I did it in 3DS $$anonymous$$ax.
$$anonymous$$ax always points things the wrong way unless you fiddle with its settings... Is your object modelled at 0,0,0 in $$anonymous$$ax?
Object was modeled at 0,0,0, but when it was done I moved it to the right to animate it. Let me see if moving to to the middle fixes this. EDIT: $$anonymous$$oving it in 3DS max does change the position when animating. Weird, anyway around that? Get's annoying when trying to quickly animate.
Answer by Paulius-Liekis · Jun 25, 2012 at 08:06 AM
This is related to animation of the root node. The root node of your weapon is animated, so when you play animation it assigns position to the root of your weapon.
Several solutions:
Do not animate root node of the weapon
Parent your weapon under another GameObject and move parent GameObject instead and let animated your weapon as it does now.
Add another root in your 3d model in 3dsMAx - when Unity finds that your object has more than one root, then it places extra parent under them both automatically (basically #2 happens) and this way you can move the model the way you want.
I personally would go for option #3 (or number #1 if you're trying to save amount of nodes).
I am trying to do option #2, but whenever I add an empty object and make my animation mesh a child of that empty object, the same effect happens.
Your answer
Follow this Question
Related Questions
How do I run two animations at once on the same game object? 2 Answers
Animation plays at original position? 1 Answer
Unity 3D Gun Animation Errors 1 Answer
Animationproblem with Lerp-Function 1 Answer
animation not playing 0 Answers