So I have this turret.
As long as the player is in line of sight of this turret (Say…bool PlayerInSight = true which is checked in Update)
the turret takes the player’s transform position at a frame(Vector3 spottedPos = player.transform.position)
it should store that Vector3 for say. 0.3 seconds without changing it frame by frame.
then 0.3 seconds pass, if PlayerInSight is still true, THEN the script updates spottedPos
and this sequence repeats itself every 0.3 seconds for as long as PlayerInSight = true. If PlayerInSight = false,
I’ve been trying to pull this off with InvokeRepeating and CancelInvoke but not only was spottedPos still updating frame-by-frame but its interval varies widely instead of being a fixed 0.3 second duration.