- Home /
Cutscene script help ?
Hello I'm having some problems with loading my cutscene, it won't play the hole movie, only part of it then stop cutting out the movie then loads to the next level, i using a script to play a .mov film in fall screen, this is the script i'm using. (the script is in C#)
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(AudioSource))]
[RequireComponent(typeof(AudioListener))]
public class level1_cutscene : MonoBehaviour {
public MovieTexture movie;
private float _movieTimer;
void OnGUI () {
GUI.DrawTexture(new Rect(0,0, Screen.width,Screen.height), movie);
movie.Play ();
if(Input.GetKeyUp(KeyCode.Escape) || movie.duration < _movieTimer) {
movie.Stop ();
Application.LoadLevelAsync("level1");
}
}
void Update () {
_movieTimer += Time.deltaTime;
}
}
You some one tell me what i'm doing wrong and tell me how to fix this problem.
Thank you for your time.
Comment