- Home /
How to start in animating model?
I got a model from TurboSquid. Which is an archer and when i imported the model I got all the textures to be put on properly. The thing is the actual character has no children nodes, is it possible to still animate this model. I have looked throughout the files and there are a bunch of textures, but I don't happen to see any animations.
Along side that the asset comes with an Avatar, I looked on the docs and still a little confused as to what that is about. If I cannot animate this model how could I force it to animate somehow or how could I make my own model.
I am not a artist at all and just focus on the gaming logic and and programming, and I am working solo. Just wondering what are some options to get a game up and running with some decent graphics. So, far I use the model to get the game play down, but now I want to make it visually appealing.
Hey cdrandin. If you got the model from turbo squid, then it probably doesn't have any animation. You could use something like $$anonymous$$aya to animate the model. However, since you are not an artist, that might be too difficult. A great place to get animated models is through the Unity asset store. They usually have scripts on them and are easy to import to your project. It can be worth it to pay 5 bucks since what you really want is to try making a nice looking game quickly.
Answer by nightstalker420 · Feb 03, 2013 at 03:49 AM
The quickest and easiest way to animate a model is to upload it to Maximo and use the autorigger, then add some of their animations. If the model is less than 10,000 polygons, then it's free, and about a dozen animations are free as well. What I do is animate the model with each animation I want one at a time, then have four or five of the same model with different animations, import them to Unity, click each animation file and click edit-duplicate. Rename the animation file to something better than maximo and script a js file to play the animation per action (i.e. walk, run, dance, fire, jump, etc.)
I'll write up a simple animation script and post it below if you want to use it, then just attach it to the character/model you want to animate.
p.s. Be sure to set the animation to Legacy under the rigging tab (click the imported models prefab, select rigging, and choose Legacy, then under the animation tab select import animations).
public var walkAnimation : AnimationClip;
public var idleAnimation : AnimationClip;
public var fireAnimation : AnimationClip;
function Start () {
animation.wrapMode = WrapMode.Loop;
animation[fireAnimation.name].wrapMode = WrapMode.Once;
animation[fireAnimation.name].layer = 1;
animation.Stop();
}
function Update () {
if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.1)
animation.CrossFade(walkAnimation.name);
else if (Mathf.Abs(Input.GetAxis("Horizontal")) > 0.1)
animation.CrossFade(walkAnimation.name);
else
animation.CrossFade(idleAnimation.name);
if (Input.GetButtonDown ("Fire1"))
animation.CrossFade(fireAnimation.name);
if (Input.GetMouseButtonDown (0))
animation.CrossFade(fireAnimation.name);
}
If you need a separate animation for walking backwards, then add a new line under:
if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.1)
animation.CrossFade(walkAnimation.name);
like this:
else if (Math.Abs(Input.GetAxis("Vertical")) < 0.1)
animation.Crossfade(backWalkAnimation.name);
and in the public var at the top:
public var backWalkAnimation : AnimationClip;
The same goes if you want a strafing animation for "Horizontal"
Be sure to recognize the difference between the greater than and less than identifiers for the positive and negative axis keys ( > for forward and < for backwards).