Answer the question
In order to leave comments, you need to log in
How to make arrow reload logic with coroutine?
Can you help with writing a reload coroutine? The algorithm is as follows: before shooting, check a boolean variable that will display whether the player is ready to shoot or not. This variable must be changed from the inspector. On a successful shot, a coroutine is launched that counts down the reload time set from the inspector, while changing the value of the boolean variable described above. I have one coroutine (lifetime) written in another script:
private IEnumerator StartLife()
{
yield return new WaitForSeconds(lifeTime);
Destroy(gameObject);
yield break;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question