I want an object to rotate after a delay. I tried using StartCoroutine
, yield
and WaitForSeconds
, but failed. How can I do it?
Answer
You could create a variable for example called timer
of type float and make it equal to the amount of seconds you would like to wait, then in the Update()
function subtract Time.deltaTime
from your timer
variable. Afterwards use if statement to check if the timer
variable is equal to zero, if so rotate the object.
No comments:
Post a Comment