- Home /
Movie texture ( I have pro )
Okay so I have Unity pro and I can import movies and it will show it in the Project section. (It has a light blue rectangle with a play symbol on it.)It has some audio clip attached to it. When I chose to play the file,however, the preview box will just turn white. (no video and no sound) I tried to drag it onto a random cube in game and it said that it had a movie texture on it. (It showed the icon that it showed in the project folder). I tried to play the scene and it still would not show. Is this normal? What can I do to fix it? I am pretty sure it is just because of my 'awesome knowledge' in Unity, but I cannot seem to figure it out. (sorry for extreme detail)
That only attaches the movie to your shader, you still need to "Play" it in code.
Answer by J3-Gaming · Aug 29, 2011 at 01:28 AM
Attach this script to your plane:
Make sure you drag the MovieTexture into the inspector.
I was able to drag the movie texture into the inspector. It still will not play, and the preview is still just a pain white screen with no sound. How long does it take to load the sound?
Answer by Draco18s · Sep 23, 2011 at 07:16 PM
The sound needs to be attached to a gameobject separately. The documentation says that it will automatically synch with the video, although I do believe that you have to tell it to play separately.
The sound is also a 3D sound, by default, can't change it. Edit the falloff settings manually so that your audio listener doesn't need to be right up next to it.
(Fun thing to do: start the movie playing, then quickly move the camera away from the sound: unity does simulate sound propagation!)
Answer by wilco64256 · Jul 20, 2012 at 12:10 AM
If you want the sound for the video to play, you need to set up an audio source component on some object. It can be the same object you're playing the video on or something else, just know that if you use it as a 3D sound you'll need to take into account the distance from the Listener in the scene.
Then you assign the audio for the video file (Unity by default will show the audio as a separate file as a child of the video clip, depending on the video type) to that audio source and either play it automatically or write code to start it playing at the same time as the video.