- Home /
Multiple Animation on an Object
I am creating an menu in witch the camera flies into the scene over the terrain. I then want the camera to move to an other part of the map when when I click the play button. The play button is a 3d text with a colider box on it and I have to seperate Animations for the the FlyIn and LevelSelect. This is the code I have on the collider.
var playing : boolean = false;
function OnMouseEnter() { //Change the text color of the test renderer.material.color = Color.red; }
function OnMouseExit() { //Change the text color of the test renderer.material.color = Color.white; }
function OnMouseDown()
{
if (!playing) {
playing = true;
animation.Play ("LevelSelect");
yield WaitForSeconds(animation.clip.length);
playing = false;
}
}
What am I not doing?
Answer by Deadguy71 · Dec 05, 2012 at 08:27 PM
You're not indicating what's wrong, or what it's doing/not doing. Does it call the animation?
You said it had two animations, but I only see a call for the one animation, does this mean you've already completed the first animation? If so, your code would need that animation to stop before fulfilling the conditional statement you left for it (assuming the first animation toggled the "playing" variable).
Try a screen debug to give you the state of the the "playing" variable to see if something else has toggled it.
Your answer
Follow this Question
Related Questions
Animated camera won't stop on collision 1 Answer
Changing collider in a sprite manager 2 animation 0 Answers
How to run 1 animation, then other 2 Answers