The playground link closely resembles what I’m trying to do.
The idea: If there is any available energy you can sprint
- If I first press SHIFT and then a button you sprint but the energy doesn’t deplete but you run.
- If I first press an ARROW KEY and then press the SHIFT key energy depletes and you run.
- If I press an ARROW KEY and then press the SHIFT key BUT then press a different ARROW KEY while still holding the SHIFT key you run but the energy doesn’t deplete.
How can I implement the running ability correctly ? What am I missing ?
In my actual game I have used similar concepts but with WASD movement attached via following this Customize Camera Inputs - Babylon.js Documentation but still I get same bad behavior.