Warning: I wrote the following post when I was tired, this may add some context to the situation or just confuse you. If you want a clearer understanding of the original question, scroll into the comments where I left two pictures and a video.
I have 6 variables, 3 are to be set by a function, and the other 3 are set by inputs
inputs:
self.stance.crou
self.stance.aimi
self.stance.runn
(these variables are set when the player does inputs, e.g if they press C it will be set to true, if not it will be false, Shift will set runn to true, if not false, Right mouse button clicked runn will be set to true, if not it will be false)
variables:
stance.aiming
stance.running
stace.crouching
these should be set to the function, which overrides the desired to either true or false based on the input
I tried to come up with the logic in notepad:
they are NOT running
-they can aim
-AND they can crouch
they are NOT crouching
-they can run
-if they are not running, they can aim
they are NOT aiming
-they can run
-they can crouch
they are ALREADY running
they want to crouch
-stop runnning
-start crouching / sliding
-can aim
they want to aim
-stop running
-start aiming
-can crouch
neither aim or crouch
-keep running
-not aiming
-not crouching
they are ALREADY crouching
they want to run
-stop crouching
-start running
-stop aiming
they want to aim
*doesn’t really matter
neither run or aim
-keep crouching
-not running
they are ALREADY aiming
they want to run
-stop aiming
-start running
-stop crouching
they want to crouch
*doesn’t really matter
neither run or crouch
-keep aiming
-not running
I’m trying to make kinda like how phantom forces work, so that you can’t crouch and run at the same time, you can’t aim and run at the same time, if you aim while running it will start aiming but if you still hold shift while taking off mouse2 it will return to running, or pressing shift again while aiming will set it to running, and if you try to run while aiming and hold aiming while still holding shift but take off shift it will go back to aiming. if you already running and try to crouch it will crouch but if you are still holding shift and stop crouching it will return to running or if you press shift again it will stop crouching and start running, and if you are crouching but press shift and still holding crouch but stop pressing shift it will stop running and go back to crouching, you get the point, basically:
RUNNING? YES.
WANT TO CROUCH? YES.
STOP RUNNING.
START CROUCHING.
STILL WANT TO CROUCH? NO.
STILL HOLDING SHIFT TO RUN? YES.
STOP CROUCHING.
START RUNNING.
RUNNING? YES.
WANT TO CROUCH? YES.
STOP RUNNING.
START CROUCHING.
STILL WANT TO CROUCH? NO.
STILL HOLDING SHIFT TO RUN? NO.
STOP CROUCHING.
STOP RUNNING.
I honestly have tried as hard as I can to describe this issue and I really hope someone can understand what I mean…
thanks