Hey,
I am wanting to create a Debug.Log to inform me when it is possible to fire a player’s weapon again. I have tried
if (nextFire < Time.time)
Debug.Log ("CAN FIRE");
with nextFire being Time.time + a set amount each time the player fires a weapon.
I have tried putting the above code in Update() but that simply constantly calls Debug.Log until it cannot fire.
I have read that a coroutine may be better in this instance to deal with time but only call something once rather than every frame as Update() does but I’m unsure as to how to go about this.
Any help would be greatly appreciated.