Godot Version
4.2.1 stable
Question
The problem is not easy to describe.
I went through the excellent tutorial for the Ultimate First Person Controller by Lukky. It all works very well. However, there is a problem when transitioning from upright to crawling at the edge of an obstacle.
In a typical game, you press the crawl button and once you’re under the obstacle, you release it. Responsive players release the button very quickly. Unfortunately, in this case, the Capsule does not stay under the obstacle, but snaps back out, as you are not yet completely under the obstacle with the central vertical axis of the Capsule (Lukkys uses the approach of a Raycast from the center of the Capsule upwards).
What would be a good solution? Several raycasts at the edge of the capsule? Replace the capsule with a cuboid? Slide a little faster under the obstacle? Increase the Lerp constant? Or expect the player to adapt to it? None of the solutions seem to make sense to me.