I am looking for a timer but im not sure which one i should use.
This is for my reload system, The timer needs to wait X seconds for the reload animation to finish. Once that has finished the timer will stop and allow the rest of the code to run.
if (WeaponInstants.CurrentInAClip < 18 && EWeaponState::Weapon_Idle) {
EWeaponState::Weapon_Reload;
if(/*Timer needs to be here and stop the following code from running until the timer has been complete*/){
NeededAmmo = WeaponInstants.MaxInAClip - WeaponInstants.CurrentInAClip;
if (NeededAmmo < WeaponInstants.TotalAmmo) {
WeaponInstants.TotalAmmo = WeaponInstants.TotalAmmo - NeededAmmo;
WeaponInstants.CurrentInAClip = WeaponInstants.MaxInAClip;
} else {
WeaponInstants.CurrentInAClip = WeaponInstants.CurrentInAClip + WeaponInstants.TotalAmmo;
WeaponInstants.TotalAmmo = 0;
}
}
}