I then added "StartCoroutine", and gave the coroutine a name: "Wait".
Finally, I added an IEnumerator with the "Wait" coroutine name. Inside that, I added "yield return WaitForSeconds(3);", and then a line afterwards that changes the CanAttack boolean to true.
I then simply added a line that calls the WaitToAttack function whenever the "1" or "2" key is pressed, effectively adding a delay that simulates drawing a sword, orpulling out a bow.
No comments:
Post a Comment