- Home /
How to trigger a cutscene movie?
Hi there,
I have another question that would be a great help if answered.
Currently i have a trigger that when my player moves into a hidden object a new scene is loaded, heres the code for that:
var 1;
function OnTriggerEnter (other : Collider) {
if (other.gameObject.CompareTag("Player")) {
Application.LoadLevel(1);
}
}
However i would like a cutscene (a simple MOV file) to play full screen after the player has triggered the event but before they have entered this new level.` (An example of this is a cutscene of a boss crashing through trees and arriving at your location, in this new scene you will need to fight this boss)
Also, if i'm not pushing it, i would like to know how to get a MOV file to play before the game is loaded, for example an intro cutscene.
Thanks, any help would be greatly appreciated!
Answer by bowditch · Apr 29, 2010 at 03:01 PM
You can create a new scene (for Application.LoadLevel) and execute this MovieTexture function on Load:
function Start () {
renderer.material.mainTexture.Play ();
}
To start loading the level in the background, use the Application.LoadLevelAsync function
Damn. I now have a problem - i don't have Unity pro, would be great if you could help me over at my new question: http://answers.unity3d.com/questions/9030/movie-playback-any-way-to-get-around-not-having-unity-pro would be great, thanks!
Then after finishing the cutscene how to go to the previous scene???
Answer by logging_out · Aug 31, 2010 at 03:00 PM
If your using Unity Indie you could do this. Duplicate your scene with the boss battle. Remove all scripts (at least ones that control the player and the boss and any other AI). Now you could recreate your .mov file by simply redoing the animation in Unity. Make sure the main camera has an animation to look at what you want it to look at. Then convert the sound of the .mov file into a .wav file. Add an audio source to your main camera and add the .wav file as the sound you want played. Then you would need to add a script that would loadlevel(1) when the animation is finished. I can't help you much there as I'm not very experienced with code. But maybe you'll know how to do this.
Your answer
Follow this Question
Related Questions
How do I make this small somewhat cutscene? 1 Answer
Movie cutscene how to? 5 Answers
movies in unity free ? 2 Answers
Opening Movie / Cutscene 1 Answer
Adding Cut scenes 2 Answers