- Home /
Question by
paco morales · Dec 20, 2012 at 07:36 AM ·
animationbuttontwo
How to play two animations with one button?
I'm trying to play two animations when I hit one button. I try to duplicated the function but shows error.
what i'm doing wrong?
Please any advise is welcome.
var Skin_battery: GUISkin ;
var beep : AudioClip;
var other : GameObject;
function OnGUI (){
//Make the First button
GUI.skin = Skin_battery;
if (GUI.Button(Rect(730,450,100,48),"")){
audio.PlayOneShot(beep);
animation.Play("Battery");
animation.Play("Tool");
}
}
@script RequireComponent(AudioSource)
Comment
are you trying to play the two animations on the same object?
what error are you seeing. are you missing an audiosource component?
Your answer
Follow this Question
Related Questions
Play two animations without using animator 0 Answers
Play a video on clicking on an object 1 Answer
Animator has not been initialized?? 3 Answers
Two Animations With One Button Press 1 Answer