Hi!
I’ve problem with the function mouse.
I Did this script, and I put it into GameObject that has Mesh Collider, and Animation.
But if I click on the GameObject, the animation dont start.
If I change the script whit button Input, It work… es: (ifInputGetKey(click a taste))
The problem is this script, or maybe some setting…
Image: http://oi41.tinypic.com/24etijs.jpg
Script:
#pragma strict
var AnimCancelloIngresso : String;
function OnMouseDown ()
{
if (Input.GetMouseButtonDown(0))
{
animation[AnimCancelloIngresso].speed = 1.0f;
animation.Play(AnimCancelloIngresso);
audio.Play();
}
}
thanks for the help !