- Home /
I want to play a MovieTexture inside a GUITexture but I can't hear the sound. Why
If I apply the MovieTexture to a Plane I can hear the sound meanwhile in a GUITexture I can only see the movie. Why is it different?
audio.IsPlaying returns true but I hear nothing. Yhy is that?
Well I've never used this, but to be honest, I find it weird that you can hear the sound when it's used on a plane. I would expect it to never work. Also, you say audio.IsPlaying is true, but what "audio" do you access ? I mean, if it's just a texture you use in GUI, then it isn't related to any audiosource in your scene at all.
Because my game object has a GUITexture component and a AudioSource component.Ant they're values are initialized like this:
guiTexture.texture=$$anonymous$$ovie; audio.clip=$$anonymous$$ovie.audioClip;
Answer by gochi7 · Mar 11, 2013 at 04:43 PM
If I remember correctly the sound must be added separately, it's basically a gif you get with a movie texture you see, so just add an audio source to the same place and add the sound, hope this helps :)
I dont see the gif. $$anonymous$$oreover I want to assign the movie and the audio dynamically. I dont want to drag them on the inspector
you gotta add the movie texture and add an audio source to the same plane
Answer by Bunny83 · Mar 11, 2013 at 05:55 PM
Are you sure you have set your AudioSource component to 2D? Just check the settings by expanding the "3D Sound settings" and make sure the "Pan Level" is 0. If you have multiple audiosources in the scene, you can increase the priority by setting the Priority value to a lower value.
Are you sure you started both, the texture and the audio after you assigned the texture / AudioClip?
I never used a MovieTexture myself, but that's all i can imagine at the moment.
I don't think it was mentioned whether 2d or 3d is being used though I do agree with you it should
Well, a GUITexture is a 2D object but since it's a GameObject it still have a position in the world. However the world position has no relation to the actual position on the screen (unless it's a child of the camera). So i'm pretty sure it should be a 2D sound.
I set Pan Level to zero but it still does not work. As its the only sound in my movie increasing the priority is not useful
now it works!! I don't know why. However the pan level must be zero