Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

PLEASE help! Movie texture not playing in build...

Discussion in 'Editor & General Support' started by garyhaus, Mar 17, 2009.

  1. garyhaus

    garyhaus

    Joined:
    Dec 16, 2006
    Posts:
    601
    I have a movie texture mapped to a monitor and it plays just fine in the editor. When I create a build either standalone or webplayer, the movie or sound do not play. Here is the code for playing back the movie. I have an audio file attached to the monitor. I have Unity Pro. Any help please?


    Code (csharp):
    1. var movieTexture : MovieTexture;
    2.  
    3. function Start() {
    4. movieTexture.loop = true;
    5. renderer.material.mainTexture = movieTexture;
    6. movieTexture.Play ();
    7. }
     
  2. Chien

    Chien

    Joined:
    May 1, 2009
    Posts:
    42
    This problem isn't solved yet.
    In the editor, if I click on the movie and play it in its tiny window, then the sound of the movie will play correctly in the editor afterword. But if I build an exe, then the sound is always mute. I have to drag the sound into scene and use

    GameObject.Find("test1 audio").audio.Play();

    to play the sound. Is there any better way to play a movie with synced sound?
     
  3. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    It is hard to tell what is happening here without seeing what is going on. Can you attach a minimal project folder to demonstrate the issue? That should help giving a more specific reply to this issue.
     
  4. Chien

    Chien

    Joined:
    May 1, 2009
    Posts:
    42
    here is the example...
    if I play the movie on the inspector's preview window, then I can hear sound afterwords. But when I create the exe file, there won't be any sound.
     

    Attached Files:

  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Ok, I just checked this out. The fact that you hear sound in the editor is a bug. The standalone player' behavior is correct. You should only hear sound, when you add the movie's AudioClip to an AudioSource in the scene. The simplest way to do this is just to drag the movie's audio to the scene.

    Now, when you play the movie in the preview, Unity creates a temporary Audio Source to play back the movie audio, which is then (wrongfully) playing back the audio from the scene as well, which is misleading, because it suggests that no AudioSource is needed for the movie. I will file a bug on this, so it gets fixed in a future build.
     
  6. symbell

    symbell

    Joined:
    May 19, 2013
    Posts:
    7
    Audio plays in different channel, you have to call audio play as well.

     
  7. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    The last activity in this thread took place four years ago!