Heya Fellas,
I’m trying to get my button (2d sprite, with sprite sheet) to animate on click.
I have the animations, I have some basic scripts and have animated on click before but I can’t get my little 2d sprite to do it.
I’m guessing It doesn’t work the same way for a 2d element as a 3d one.
I have a 2d collider set, i have the animations all set.
I used this code on the 3d version of the button but i’m trying to get a 2d sprite version happening.
#pragma strict
var playing : boolean = false;
function OnMouseDown()
{
if (!playing) {
playing = true;
animation.Play("Button_001");
yield WaitForSeconds(animation["Button_001"].length);
playing = false;
}
}
function Start () {
}
function Update ()
{
}
Any and all hep would be much appreciated
Morph