E.g. when the character dodges, it can’t switch weapons until after the dodge has finished. If the player switches weapons during the dodge, I want it to automatically switch to the selected weapon after the dodge has finished.
Hello, i think u could try this instead of disable input:
- You can make boolean Variable - “isPlayerDodge” (yes or no) and make “branch operator” : player can switch weapon, or can make moves “IF” only if variable “isPlayerDodge” set to “no”.
- After that u make another IF - if player press E for switch weapon while player dodge (“isPlayerDodge” - it would be set to “yes” in that case), wait some “delay” and switch weapon.
Just like u making Jump mechanics, u can jump only once in time, and usual u make boolean Variable isJumping, for checking current status of Player to avoid endless jump key press.
No need disable PlayerInput for such things.
you could make an array, could be string array or key structure array.
when key is pressed, if there is an input blocking flag, add the key to array.
Once input blocking flag is cleared, get top index from array and run whatever logic you want from it.
In other words, store inputs to an array, then you can read them back sequentially later.
Found out that it’s referred to as an input buffer, got a bunch of results on Google. Will probably do something similar to what you said, thanks!