Hey everyone, new guy here.
I did a search and didn’t find any results that helped me. Maybe my terminology is bad since I am still learning.
But here is what I am trying to accomplish.
Bare minimum: One player definable key to perform multiple character actions depending on whether it is being pressed or held.
Ideal: When letting a player map their own keys, have the option of a key being held. Like I want to jump when space is pressed, but I can go to my “Sprint” binding and hold space bar and it will say, ok, sprinting = spacebar-held.
What I want to accomplish as a bare minimum as this is really what I need it for but would love to allow any action to be mapped to a “held” button/key.
One key/button that has multiple uses depending on its state(?).
Setting the “B” button on a controller or “Q” on a keyboard to do the following:
Pressed(tap) while standing = Crouch
Pressed(tap) while crouching = Stand
Held while standing = Prone
Held while crouching = Prone
Pressed(tap) while proning = Crouch (double tap to stand since pressing while crouching makes you stand)
I know there will be a slight delay (I am assuming I can pick the length that determines a ‘held’ vs ‘press’)
I think Battlefield 3 has a similar set up.
Any advice and code examples would be greatly appreciated. I don’t want someone to write the entire script for me because I want to learn but a nudge, or a nice firm shove would work to, in the right direction would help a lot.