- Home /
How To Play Animation
Hello Unity3D.I have a question about animations?How can i make i that when my character plays a certain animation it plays another after that specific animation?For example,My character plays an animation named walking then if that character is playing that animation it plays an animation named run right after that animation automatically.If anyone knows how i can make my player play one animation if another one is playing.Can you please tell me how?
P.S Heres what i got so far
var player : GameObject;
var cam : GameObject;
var Teleport : GameObject;
var ground : Transform;
var RoarCameraPosition : Transform;
var Roar : GameObject;
var mouth : Transform;
function Start (){
if(!player.animation.IsPlaying("Burn_To_Hell_Part_2")){
player.animation.Play("Jump");
cam.transform.position = RoarCameraPosition.transform.position - RoarCameraPosition.transform.forward;
cam.transform.Rotate(0,180,0);
Instantiate(Roar,mouth.transform.position,mouth.transform.rotation);
Switch2();
}
}
function Switch2 (){
yield WaitForSeconds(3);
Instantiate(Teleport,ground.transform.position,ground.transform.rotation);
}
You should seriously move on to the new animation system. It's much easier, more effective, and has more support. I learned it in under an hour, so it can't be that difficult to understand.
are you reffering to mecanim?because everytime i use mecanim it messes up my characters animations
I have to agree with @Wolfdog. $$anonymous$$ecanim is very useful. What do you mean it messes up your character animations anyway? All else to shame, you can use something like this: if(Animation.isPlaying("YourFirstAnimation") { Animation.PlayQueued("YourSecondAnimation"); } else { return; }
like most of the animations looks all wiggly and the limbs move all over the place
Answer by Geva93 · Jun 11, 2015 at 08:53 AM
you can do it easy throw mecanim, place "idle" state and then when you move place a "move" state and when the move state is finish you put after it a "run" state and it will automatic go to the "run" state
Your answer
Follow this Question
Related Questions
Decreasing Player Health On Collision with Enemy 2 Answers
Animation on Raycast Not Playing 1 Answer
How to make collision check if other collider has component 1 Answer
Play annimation on collision not working. 1 Answer
Can I use Animator.bodyPosition for modifying the colliders during an animation? 1 Answer