- Home /
Question by
Dan Jimenez · Feb 17, 2011 at 07:07 PM ·
animationguiresetrewind
Play one animation and rewind another
I have one animation controlled by a GUI button. When pressed an object slides onto the screen. Sometimes there might be another object on the screen that has slid on the screen from another GUI button. What can I add to my code to buttons to make the other animation rewind and slide off of the screen when one slides on. here is an example of my button.
function OnGUI () { if (GUI.Button (Rect (10,10,70,20), "RED")) {
animation.Play("Redinfo");
}
}
the name of the second animation clip is titled "blackinfo" I want this animation to rewind and slide off the screen when the Red GUI button is pressed. Thanks
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613104918im_/https://answers.unity.com/themes/thub/images/avi.jpg)