Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move_and_slide jitters when colliding with flat wall and angled surface #643

Closed
ghost opened this issue Oct 13, 2023 · 1 comment · Fixed by #860
Closed

move_and_slide jitters when colliding with flat wall and angled surface #643

ghost opened this issue Oct 13, 2023 · 1 comment · Fixed by #860
Labels
bug Something that isn't working as intended severity:minor Small impact on functionality or usability topic:runtime Concerning runtime behavior (or its source code)

Comments

@ghost
Copy link

ghost commented Oct 13, 2023

When running against a gap that is barely not large enough for the collision shape the CharacterBody3D will jitter and jumping is affected.

Cylinder Shape: The CharacterBody3D will jitter and is_on_floor() will flip between true and false. Jumping is nearly impossible since you do not get the right amount of height from a jump.

Capsule Shape: The CharacterBody3D will jitter and is_on_floor() will flip between true and false. Jumping is nearly impossible since you do not get the right amount of height from a jump.

Box Shape: The CharacterBody3D will jitter but is_on_floor() is right. Jumping is nearly impossible since you do not get the right amount of height from a jump.

The jumping bug does still happens when the gap is much smaller than the width of the collision shape.

Setting the amount of max_slides to a value much higher ( I use ~20) than default will fix the jumping issue, but the jitter issue and is_on_floor() issue is still present. This happens with 60 physics ticks per second and 100 physics ticks per second with no change. These scenarios occur with default jolt settings on 0.9.0 and 0.8.0. Not entirely sure if this is a known issue or not. Since it affects the most common collision shape I thought it would be worth making this issue anyways.

MRP is included. The .godot and addons folder are not present in the MRP so godot-jolt needs to be installed.
Setting the max amount of slides is commented out in the _ready() function. is_on_floor() is printed at the beginning of every physics tick in the console. All that is needed to change collision shapes is to change CShape in player.tscn (The default sizes of the named collision shapes are what should be used).

MRP-Jittering.zip

@github-actions github-actions bot added the needs triage Something that needs investigation label Oct 13, 2023
@mihe mihe added bug Something that isn't working as intended topic:runtime Concerning runtime behavior (or its source code) severity:minor Small impact on functionality or usability and removed needs triage Something that needs investigation labels Oct 13, 2023
@mihe
Copy link
Contributor

mihe commented Oct 13, 2023

Thank you for reporting this, and for providing the minimal repro.

Jumping is nearly impossible since you do not get the right amount of height from a jump.

Assuming I'm actually performing the repro correctly, this particular thing seems to happen with Godot Physics as well, where jumping will be severely hindered when you push yourself into one of these corners. Bumping up max_slides to a higher value does indeed fix this, as you point out.

As for the jittering and flip-flopping of is_on_floor, I'll have to do some more in-depth debugging to see why/where this diverges from Godot Physics. I would've bet money on it being a regression caused by #559, similar to #626, since that seems to have messed with some floor stuff internally within move_and_slide, but that does not appear to be the case.

@mihe mihe changed the title Jitter and getting stuck when colliding with flat wall and angled surface move_and_slide jitters and gets stuck when colliding with flat wall and angled surface Mar 20, 2024
@mihe mihe changed the title move_and_slide jitters and gets stuck when colliding with flat wall and angled surface move_and_slide jitters when colliding with flat wall and angled surface Mar 20, 2024
@mihe mihe closed this as completed in #860 May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working as intended severity:minor Small impact on functionality or usability topic:runtime Concerning runtime behavior (or its source code)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant