- Home /
Script plays only once [Android]
Greetings. I have such problem: this script play animation only once, I mean when I touch button, it works, but if I touch again, nothing happend. What I should add to this script?
function Update() {
var ray: Ray = Camera.main.ScreenPointToRay(Input.mousePosition);
var hit: RaycastHit;
if (Input.GetMouseButtonDown(0) && Physics.Raycast(ray, hit, 100))
{
if (hit.collider.gameObject.tag == "newgame")
{
animation.Play("newgame");
}
}
}
Comment