- Home /
UI text animation
Hello I have UI text and attachet animation to it not the animation controller just animation. And simple script that's have to play animation. But when i collide to it nothing happens. This is script
#pragma strict
var SweeperL : GameObject;
var SweeperR : GameObject;
var sideR : GameObject;
var sideL : GameObject;
var text : GameObject;
sideR = GameObject.Find("SideR");
sideL = GameObject.Find("SideL");
SweeperL = GameObject.Find("SweeperL");
SweeperR = GameObject.Find("SweeperR");
text = GameObject.Find("TextR");
function OnTriggerEnter2D (col : Collider2D) {
if(col.tag == "Player"){
SweeperL.transform.position.y = 24.7; //this works
SweeperR.transform.position.y = -0.7;//this works
sideR.animation.Play("fadeR");//this works
sideL.animation.Play("fadeR2");//this works
text.animation.Play("leftsht");//this doesn't works!!!
}
}
animaton is legacy!!!
Comment