I have a function that I would like to limit the use of via two variables
`
var nextUsage;
var delay=2;//two seconds delay.
`
basically what I would like to do is set nextUsage upon start so that it has the value of the time. When the user uses the function, a check will be run to see if the time has passed, if so, use the function and add the delay amount to nextUsage.
I keep getting these two errors however:
NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator (System.String operatorName, System.Object lhs, System.Object rhs)
Movement.Update () (at Assets/Scripts/Movement.js:269)
which point to this line:
`
if(Input.GetButton(“Spin”))
{
if(NextAttackTime>=Time.deltaTime)//line 269
{
NextAttackTime+=AttackDelay;//set the nextattack time
spinattack();
}
}
`
I’m a little confused. Any ideas?
I've tried everything short of copy and pasting Dave's code. Doesn't seem to work for me still.
– TheEmeralDreamer