Kickstarter campaign is Live!
Jump to content

Recommended Posts

Posted

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.

  • Thanks 1
  • 4 weeks later...
Posted
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

Let's build cool stuff and have fun. :)

Posted

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

Let's build cool stuff and have fun. :)

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...