- Home /
Can I scale an animation with a model?
I want to duplicate a model and have its animation scale with its size. Is this possible?
Duplicate no, scale yes. Would you like me to tell you how?
Yes - Thanks for the detailed tutorial on using the animator.
Perhaps I was not clear enough in my original post.
I want the animation to scale with the size of the object - so the animation has already been made - and I merely want to duplicate it and have another model, of different size, perform the same animation in accordance to its own size.
Answer by LightSource · Mar 12, 2013 at 05:24 PM
Okay, welcome to the wonderful word of animation.
1) First you will need to create a new animation. If you see the "create" tab above your project view, you can make an animation from there. You can call it what ever you want, but for the sake of demonstration, lets call it "Scale".
2) Drag the animation from your project view onto your gameObject. If it is not Unity generated (imported) then it will ask you to create a new avatar for it. Go ahead and press yes.
3) Now open up your animation window. If you don't have one open, go to Window > Animation in your upper bar, and snap the new window where ever you want.
4) In the animation window you should see a box with lines and numbers. Keep in mind the numbers are FRAMES not SECONDS, zooming in and zooming out will increase/decrease the number of frames in your view.
On the top of your window you should see two drop down menus, one is your gameObject and next to it should be "Scale" or whatever you named your animation. Make sure these are correct.
5) If you have the above steps correctly you should see your gameObject in the animator menu, where it should have a triangle you can drop down to see X, Y, and Z values of Rotation, Position and Scale. Righ click on the little gray line next to one of the X, Y, or Z values and select add curves.
6) Now the recording button should have turned red. Zoom out in your animator and click on the "10" frame listing. This means that whatever your do to your object now in scale, it will make it a key frame and will change the values of the object until it gets to your set frame.
7) In your scene view select the scale tool and do whatever you want to your object. This should create lines in your animator. Now when you press play, it should change, over 600 frames, to whatever size you wanted it to be.
Any questions?
Yes - Thanks for the detailed tutorial on using the animator.
Perhaps I was not clear enough in my original post.
I want the animation to scale with the size of the object - so the animation has already been made - and I merely want to duplicate it and have another model, of different size, perform the same animation in accordance to its own size.
If you Scale the model, the animation will be the same.
Answer by JDUnity · Jun 12, 2013 at 05:03 PM
Got it working, you just have to parent it to an empty game object which will be the one you'll rescale. Cheers! easy
Answer by Shinugami · Nov 08, 2013 at 08:18 AM
I had a problem with scale also. When the animations played the size was fine but in game-design mode the gameObjects had to remain very small (despite being at scale 1) otherwise in the game they would become huge. I had a look at the bones in the imported mesh and I recall in 3D programs the 'root' bone controls the scale of everything. Sure enough my problem was that the root bone's x,y,z scale was at 0.3. I increased these to x,y,z at 1.0 and now in game-design mode I don't have to be discouraged by having small characters that will become bigger. I can design the level and see them the way they will be during play.
Making sure the animations are attached to their fbx model and making the model import at the same scale as the mesh that the animations will be applied to. If I did not do this then the poor character looked like he was a sack of skin with some retarded bones jiggling inside his mesh. Make sure they are the same scale. And make sure the bones are the same scale (in my case the mesh being animated had a different root bone scale, this was fixed as the animation animates the scale of the bones to be the same as the animation - however in game design it was distracting to see)