htharker1 Posted January 19 Posted January 19 1. when crouching under an object or geometry, jumping causes the controller to pass through whatever is above them. Jumping shouldn’t be possible when crouching 2. Sprinting while crouching is possible when it obviously shouldn’t be. As funny as the idea is, it needs to be patched out. 3. The code ignores the crouching speed when crouching so the player moves at the same speed regardless of if crouching or not. 1 Quote
Josh Posted Tuesday at 05:23 PM Posted Tuesday at 05:23 PM On 1/19/2026 at 7:17 AM, htharker1 said: 1. when crouching under an object or geometry, jumping causes the controller to pass through whatever is above them. Jumping shouldn’t be possible when crouching It looks like this can happen, under some circumstances. The problem is that the player's height gets smaller when crouched, and the stepping-up behavior can get activated if they intersect the ceiling fast enough, pushing them up. A temporary solution is to disable jumping when crouched. I have added this to the Lua script. On 1/19/2026 at 7:17 AM, htharker1 said: 2. Sprinting while crouching is possible when it obviously shouldn’t be. As funny as the idea is, it needs to be patched out. Here is the fix: running = entity->GetCrouched() == false and window->KeyDown(KEY_SHIFT); On 1/19/2026 at 7:17 AM, htharker1 said: 3. The code ignores the crouching speed when crouching so the player moves at the same speed regardless of if crouching or not. This seems to be working fine, in C++ at least: if (running) { speed *= 2.0f; } else if (crouched) { speed *= 0.5f; } However, this was not working with Lua, so I fixed it. Here is the scene I am testing with: FPSTest.zip Quote Let's build cool stuff and have fun.
Josh Posted Tuesday at 05:40 PM Posted Tuesday at 05:40 PM These changes are now available on the beta branch. You will need to sync your project to get the updated files. If you have the project set to never copy .lua files, they won't get updated. The one remaining issue is that if you enable jump while crouching, the player can get pushed up or out of objects. This could be prevented if I add an extra convex cast when the vertical speed is greater than zero. FPSPlayer.lua Quote Let's build cool stuff and have fun.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.