Hello, wonderful community.
Im here again asking for your help in trying to separate the outcomes of a key TAP (very short press) and a key HOLD (holding down the key).
What im trying to do is:
- Start the reload when the player TAPS R
- Check ammo when the player HOLDS R
I've managed to achieve both correctly, but not at the same time.
With everything i tried, i end up with either the reload starting too when i try to check the ammo, or the reload starting when i finish checking ammo. Here's the relevant code:
if !Gunvars.isreloading and Input.is_action_just_pressed("reload"):
if Playervars.playergun == "Pistol (pickup)":
Basically, CHECK AMMO works if you hold R down for 0.5 seconds (The duration of "Ammocheck" timer), this cancels if you interrupt the key hold.
RELOAD, on the other hand, always works, the bottom line is that i want to be able to check my ammo without reloading too.
I've been trying to figure this out for some time now but after a long day im burned out :P
Thanks in advance!