I want my object to do once when condition is met?
var range: float;
function Update()
{
if(range<5)
InvokeRepeating("shoot",3,2); //I want to do this just one time else CancelInvoke("shoot"); //If range is >=5, this Invoke will be canceled }
function shoot()
{
//do something
}
Can someone help me thanks in advance!