I’m currently working on a reload function and when I call the GetKey which in this case is R it only does a single frame (I’m using time.deltatime) does anybody know a way to press a key and have it commence a timer (the reload timer) I’ll paste the reload function below if that helps at all.
if (Input.GetKeyDown (KeyCode.R)) {
reloadTime = StatMaster.statM.gunSlot.itemReloadTime; {
if (reloadTime > 0) {
reloadTime -= Time.deltaTime * 1;
if (reloadTime <= 0) {
ammoCount = StatMaster.statM.gunSlot.itemAmmoCapacity;
reloadTime = 2.0f;
}