Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How can I get my Movie Texture to completely stop?

Discussion in 'Editor & General Support' started by coolfunkDJ, Nov 4, 2014.

  1. coolfunkDJ

    coolfunkDJ

    Joined:
    Aug 21, 2014
    Posts:
    2
    The problem I am having is the "movie.Stop()" function stops the movie but rewinds it back to beggining

    I want to have it so that when my movie stops playing or when I press a button down, it goes to the Menu Scene

    I have managed to do it for when my movie stops playing using .isPlaying() but when I do it flashes black :/

    it is impossible with movie.Stop(), so is there some other method I should know about?

    Thank you, I am quite new to Unity as I usually used to just code websites :p ;)

    Script:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. [RequireComponent (typeof(AudioSource))]
    5.  
    6. public class Video : MonoBehaviour {
    7.  
    8.     public MovieTexture movie;
    9.  
    10.     // Use this for initialization
    11.     void Start () {
    12.         renderer.material.mainTexture = movie as MovieTexture;
    13.         movie.Play();
    14.     }
    15.  
    16.     void Update () {
    17.     if(movie.isPlaying){
    18.         Debug.Log("Still Playing");
    19.     } else {
    20.         Application.LoadLevel("Menu");
    21.     }
    22. }
    23. }
     
    Last edited: Nov 4, 2014
  2. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
  3. coolfunkDJ

    coolfunkDJ

    Joined:
    Aug 21, 2014
    Posts:
    2