Cooldown system thingy
So I've been trying to get a cooldown for my reset rotation button to work,and the cooldown itself does work but the transform.rotate still works even while on cooldown,here's my code
{
public bool risready;
void Start()
{
rotatespeed1 = 60;
risready = true;
}
void FixedUpdate()
{
if (Input.GetKey("r") & risready )
{
risready = false;
if (risready) transform.Rotate(new Vector3(0, 0, 0) * Time.deltaTime);
StartCoroutine("wait");
}
if (risready = false)
{
}
}
public IEnumerator wait()
{
yield return new WaitForSeconds(10);
risready = true;
}
}
Comment
Your answer
Follow this Question
Related Questions
script enable=false 3 Answers
Animation Problem 0 Answers
Making bool true on GetKeyDown and false once animation is done 2 Answers