Hello how can I disable an object after you press 10 times the left-muose? This is the script that I'm using, but does not work very well.
My script.
#pragma strict
var myTrigger : GameObject;
var myObject : GameObject;
var countAmmo : int = 10 ;
function Start()
{
}
function Update()
{
if(Input.GetButtonDown("Fire1"))
countAmmo = 10;
//myObject.SetActive(true);
countAmmo = (countAmmo -1);
countAmmo = 0;
myObject.SetActive(false);
}
↧