2

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?

Coral Doe
  • 1,925
  • 3
  • 19
  • 36
Ananya
  • 345
  • 2
  • 5
  • 15

3 Answers3

1

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 .

var movTexture : MovieTexture;    //create a MovieTexture variable

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();
}
Kari
  • 1,244
  • 1
  • 13
  • 27
Ananya
  • 345
  • 2
  • 5
  • 15
1

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/

druss
  • 1,820
  • 19
  • 18
0

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.

CC Inc
  • 5,842
  • 3
  • 33
  • 64