+ 1
How to wait for seconds using enums
just say ienumerator void (function name ) and within curly braces write the yield new waitforseconds and in parenthesis how many seconds you want to wait just close it and in start or update method write startcorotene nd within parenthesis the name of the method and you are good to go
1 Resposta
0
To wait for a specific duration of time using enums in Unity, you can use the IEnumerator coroutine. By defining a coroutine function that includes a "yield return new WaitForSeconds()" statement, you can pause the execution for the desired time. Simply call this coroutine function using StartCoroutine() in either the Start or Update method. This way, your script will execute in a more organized manner, allowing for pauses and smooth transitions in your game logic.