- Home /
Question by
AmeRevenge · Dec 11, 2013 at 06:14 PM ·
reloadreloading
C# Reload Script
Hi guys i need help with coroutine for reload delay... I really don't know how to make a Coroutine, can you help me please? :)
void Reload()
{
reloading = true;
currentWeapon.wepTransform.animation.Play(currentWeapon.reloadAnim);
count = 30;
reloading = false;
}
Comment
Answer by robertbu · Dec 11, 2013 at 06:16 PM
Try this:
IEnumerator Reload()
{
reloading = true;
currentWeapon.wepTransform.animation.Play(currentWeapon.reloadAnim);
yield return new WaitForSeconds(1.5f);
count = 30;
reloading = false;
}
You will call it:
StartCoroutine(Reload());
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Need a script 0 Answers
Problems Scripting a Camera 1 Answer
sound on key down help 2 Answers
Teleport enemy after player collides with an object? 0 Answers