In the current version of the code there appears to be a bug with crouching, I noticed my camera wasn't going back to its original height when uncrouching and I confirmed it with some in game debug prints of the camera height. After trying a couple different things to fix it I figured out it was a bug in the _physics_process function of crouch,gd, basically in the if check to see if the player is crouching, if the player isn't crouching it immediately unsets the crouch state without fully doing the camera lerp back up to the original head height so it only partially reverts. So I added a check to see if the difference between the current head position and the original is less than 0.1 and if so it snaps it to the original position and only then does it unset the crouch state
In the current version of the code there appears to be a bug with crouching, I noticed my camera wasn't going back to its original height when uncrouching and I confirmed it with some in game debug prints of the camera height. After trying a couple different things to fix it I figured out it was a bug in the
_physics_processfunction ofcrouch,gd, basically in the if check to see if the player is crouching, if the player isn't crouching it immediately unsets the crouch state without fully doing the camera lerp back up to the original head height so it only partially reverts. So I added a check to see if the difference between the current head position and the original is less than 0.1 and if so it snaps it to the original position and only then does it unset the crouch state