- Home /
Question by
ForeignGod · Mar 03, 2013 at 02:47 AM ·
javascriptanimation scriptidle
Go Idle after Animation
I've been trying to add an Idle animation after my player finishes etc Stab animation, but i can't get it to work? I appreciate any help i can get, here is my script so far
function Start() {
animation.Play("Idle");
}
function Update() {
if(Input.GetKeyDown(KeyCode.Mouse0) && Input.GetKeyDown(KeyCode.Mouse1))
animation.Play("Stab");
else if(Input.GetKeyDown(KeyCode.Mouse0))
animation.Play("RightShoulder");
else if(Input.GetKeyDown(KeyCode.Mouse3))
animation.Play("Block");
else{
animation.CrossFade("Idle");
}
}
any suggestions?
Comment
What exactly happens when you left click? Does it play "RightShoulder", and stop, or does it not play at all?
after ive etc left clicked it plays the animation totally fine, but after the rightshoulder animation is done the idle animation does not start again. same with the other animations
Your answer
Follow this Question
Related Questions
Stop spawning enemies when a bool is enabled 0 Answers
Problems with creating custom EditorGUI for script 0 Answers
Call JavaScript from c# Help! 0 Answers
Directory.GetFiles() , not sure if bug or noob inside 0 Answers
String.Split() Function Issues 1 Answer