Question

I'm trying to add .mov file into my unity project and want to play that video file in a scene.how can i create a scene with video playing in unity 3d?

Was it helpful?

Solution

Thanks,It was the problem with Unity Pro version.Now i'm working with Unity Pro and Videos are working properly .

U can use the following javascript after importing the video file into asset folder .

//create a MovieTexture variable

var movTexture : MovieTexture;

function Start () {

renderer.material.mainTexture = movTexture; movTexture.Play();

}

function Update () {

  if(Input.GetButtonDown ("Jump")) {
    if (movTexture.isPlaying) {
        movTexture.Pause();
    }
    else {
        movTexture.Play();
    }
}


if(Input.GetKeyDown(KeyCode.Space))
    movTexture.Stop();

}

OTHER TIPS

Do not forget to install QuickTime if you are using Windows for development. Otherwise, you will not be able to import *.mov file into your project. Here is small instruction how to import and play video in Unity3d: http://druss.co/2015/05/unity3d-how-to-play-video-in-unity-project-movietexture/

Yes, what you can do, if you have Unity Pro, is use Movie Textures.

Movie Textures are animated Textures that are created from a video file. By placing a video file in your project's Assets Folder, you can import the video to be used exactly as you would use a regular Texture.

If you do NOT have Unity Pro, then you are out of luck unless you want to try using one of the methods outlined in this answer, however I would not recommend that because of poor performance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top