public class Timer : MonoBehaviour
{
public bool startTimer = false;
[SerializeField]private float delay = 5f;
public float timer;
void FixedUpdate()
{
if(startTimer){
timer = delay - Time.deltaTime;
if(timer <=0)startTimer =false;
}
}
}
void Start
{
timer=delay;
}
void FixedUpdate()
{
if(startTimer)
{
timer = timer - Time.fixedDeltaTime;
if(timer <=0)
{
startTimer =false;
timer=delay;
}
}
}