- Home /
Animation end trigger
I need help with a cutscene in unity pro, basically what I am trying to do is after a the camera aminimation is done, I want it to go to the next scene, which is named Horror. Basically this cutscene is just you getting up from the ground whilst breathing heavily (From a first person perspective) Help!
Answer by LightSource · Mar 28, 2013 at 12:53 AM
Here is a concept to start you off.
var hold : int = 5; //Set this for how long your animation is
function Update () {
//Play animation
wait()
Application.LoadLevel(); //Your scene
}
function wait () {
yield WaitForSeconds ((hold));
}
I'll try. ... It didn't work. I tried C# and javascript, but what it did was it said on the java script one that it was expecting "EOF" at the first line ins$$anonymous$$d of "hold" I am using unity 4.0, maybe it's part of a new update? And the C# ended in total devastation. :/ Ok, I'll update my unity and see if that works. ... Which will take an hour. D:< Nope, it's not working. Here's what I get; Assets/animation.js(1,1): BCE0044: expecting EOF, found 'hold'.
Oops,it needs var before it. And it is a Javascript. I'm changing it now.
Unity updates do not change javascript.
I hope this works... ... It didn't! D: This is what happened; Assets/animation.js(7,7): UCE0001: ';' expected. Insert a semicolon at the end.
Oh come now... you can fix this one cant you? Put a semi-colon at the end of wait().
Derp. Puts semicolon ... Assets/animation.js(9,22): BCE0023: No appropriate version of 'UnityEngine.Application.LoadLevel' for the argument list '()' was found. D:< Wait... I think I know what to do here... Nope, I broke it even more. >.< I just reset the code before I broke it. :P I just started using unity 6 days ago, and I haven't quite learned what the error reports mean yet. Done updating this comment. WAIT! I FIXED IT! I FIXED IT! :D
var main$$anonymous$$enuSceneName : String;
var hold : int = 11; //Set this for how long your animation is
function Update () {
//Play animation
wait();
Application.LoadLevel(main$$anonymous$$enuSceneName); //Your scene
}
function wait () {
yield WaitForSeconds ((hold));
}
... Never$$anonymous$$d, the cutscene doesn't even have time to do it's thing, it just goes to the game. ._.
Your answer
Follow this Question
Related Questions
Drop down menu trigger'd cutscene 0 Answers
Wait() is not working for me! 2 Answers
Trigger an animation 1 Answer
play a door animation with collider 1 Answer
call/trigger animation of other object 2 Answers