Hello, I'm trying to work out how to make movie textures play inside GUI buttons. Currently I have the movie clip visible within the button, but I can't get it to play. Ideally I would like it to play as soon as the mouse hovers over it and stop playing once the mouse has moved off the button.
Here the code so far:
var horizRatio = Screen.width / 800;
var vertRatio = Screen.height / 600;
var button1Movie : MovieTexture;
function OnGUI () {
GUI.BeginGroup (Rect (horizRatio + 800, vertRatio + 100, 230, 400));
GUI.Box (Rect (0,0,230,400), "Slow Moves");
GUI.Button (Rect (10,40,100,80), button1Movie);
GUI.Button (Rect (10,130,100,80), button1Movie);
GUI.Button (Rect (10,220,100,80), button1Movie);
GUI.Button (Rect (10,310,100,80), button1Movie);
GUI.Button (Rect (120,40,100,80), button1Movie);
GUI.Button (Rect (120,130,100,80), button1Movie);
GUI.Button (Rect (120,220,100,80), button1Movie);
GUI.Button (Rect (120,310,100,80), button1Movie);
GUI.EndGroup ();
}
I know I have to put `renderer.material.mainTexture.Play();` in somewhere along with a `function OnMouseOver () {` but I have no clue. As you may have guessed by now I'm not a coder, but I'm learning, please help!
Thank you :)