Skip to content

Bug with crouching (it was easy to fix) #4

Description

@TheRektafire

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions