Plaing movie textures with GUI Texture button

Dear all,

I am trying to Play movie textures via GUI Texture Button. But every time i try it says renderer is missing… So what to do. I am using Unity 2.6.1 Pro

Please Post a reply…

Can you post the code that is giving your this error?

Dear Andeeee,

Here is the full detail. I created a GuiTexture button named " PlayButton". Then i attached following script to PlayButton.

PlayButton Script:

//var levelToLoad : String;
var normalTexture : Texture2D;
var rollOverTexture : Texture2D;
//var beep : AudioClip;
var QuitButton : boolean = false;

function OnMouseEnter(){
guiTexture.texture = rollOverTexture;
}

function OnMouseExit(){
guiTexture.texture = normalTexture;
}

function OnMouseUp(){

if(QuitButton){
Application.Quit();
}

else{
renderer.material.mainTexture.Play();
}

}

Then i attached movie texture named “MyMovie” to a game object named “MyTv”.

When i run the game , this message appears in the console. " There is no renderer attached to PlayButton but the script is trying to access it."

Kindly Help me…

PlayButton Script:

//var levelToLoad : String;
var normalTexture : Texture2D;
var rollOverTexture : Texture2D;
//var beep : AudioClip;
var QuitButton : boolean = false;

function OnMouseEnter(){
guiTexture.texture = rollOverTexture;
}

function OnMouseExit(){
guiTexture.texture = normalTexture;
}

function OnMouseUp(){

if(QuitButton){
Application.Quit();
}

else{
renderer.material.mainTexture.Play();
}

}

Then i attached movie texture named “MyMovie” to a game object named “MyTv”.

When i run the game , this message appears in the console. " There is no renderer attached to PlayButton but the script is trying to access it."