After hours of tedious and infuriating work: I couldn’t conclude this. So I’ve been trying to make a script that alternates the stance of the player, which would consist of: Standing, crouching, and proning. Unfortunately, I’m not well experienced to properly produce such script, as I attempted for hours.
Here’s what I have so far:
from bge import logic, events
scene = logic.getCurrentScene()
cont = logic.getCurrentController()
own = logic.getCurrentController().owner
key_none = logic.KX_INPUT_NONE
key_tap = logic.KX_INPUT_JUST_ACTIVATED
key_active = logic.KX_INPUT_ACTIVE
ZKEY = logic.keyboard.events[events.ZKEY]
XKEY = logic.keyboard.events[events.XKEY]
#Transition Logic
if own["Standing"] == True:
own["Crouch"] = False
own["Prone"] = False
if ZKEY == key_active:
own["Crouch"] = True
if own["Crouch"] == True:
own["Standing"] = False
own["Prone"] = False
if ZKEY == key_active:
own["Standing"] = True
Sorry, it’s a bit unfinished. Well sorry if I have to ask you guys, my bad…