-
Notifications
You must be signed in to change notification settings - Fork 86
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
collides with edges between separate StaticBody3D
#952
Comments
Would you mind sharing that scene/project? |
joltissueexampleproject.zip Had to remove the addons folder as it made the file to big so you will have to add jolt yourself |
This comment was marked as resolved.
This comment was marked as resolved.
Godot.Engine.2024.08.22.-.11.02.57.04.DVR.-.Trim.mp4Heres a video of me getting in in the test project I sent, it is way less consistent than in my main project Godot.Engine.2024.08.22.-.11.00.50.03.DVR.-.Trim.mp4 |
I tested the shared project, by disabling |
Oh cool, yeah I just tried that and it is much better, especially sliding along the staircase |
Yes, thank you for providing the project, I was able to reproduce the issue. It seems you beat me to the punch with figuring out part of the solution, but there's a bit of a story to tell here. With the way you've set things up in that particular project, where you have your wall segments be separate This is something you'll find happens with Godot Physics as well, although typically more with shapes like This has already been addressed to some degree in this extension with the project setting What caught me by surprise a little bit is that your acceleration of the player (using Another thing that caught me by surprise is the effect of the shape margins on this problem, specifically when using a single The shape margins (called "convex radius" in Jolt) effectively round the edges of any convex shapes that have sharp edges, like This is a fairly common technique used as part of the collision detection algorithm that Jolt uses, which (from what I understand) serves as both a performance optimization and helps with accuracy as well. You can indeed disable these margins globally through the Anyway, I messed around with your project a bit to illustrate all of this: wall-segments.zip If you click on the |
@jrouwe I'd be curious to hear what your take is on this. I vaguely recall you mentioning something about |
move_and_slide
collides with edges between separate StaticBody3D
The significant loss of velocity is surprising, but I guess the slightly rotated contact normal results in it more or less wanting to slide backwards, which would translate into (nearly) stopping instead.
That's how other physics engines (like Bullet) typically implements them, from what I understand, which obviously makes the shape bigger than expected, which can be frustrating in other ways. Jolt does it a bit differently, where it first shrinks the shape by the margin and then "inflates" it again. You can see it mentioned here in its documentation.
Right, yeah, that's a good point. I suppose that's a fairly easy workaround as well. |
I guess I just expected it to look more like walking along a bumpy wall Ah I see how that works, yeah upsides and downside to both Unfortunately the tools I am using to whitebox out all my levels makes this quite hard, luckily the margin option is only a one line change that only effects whitebox collision only |
I will also say that setting the margin to 0 has been shown to produce some problematic collisions when you're dealing with something like a It might be that it's instead better to set the margin of your whiteboxing to as small of a number as you can tolerate, rather than setting it to 0. |
This function uses W.r.t. to margin, I would indeed not set it to zero, but you can lower the default. |
It sounds like there might be something weird going on then. I'll try and debug it and see if I can figure out what's happening exactly. |
Tested using a capsule collision shape when running along a wall/anything with two or more static bodies if they are perfectly aligned you will get stuck or hitch where they align.
This is very obvious is you create a staircase like this and run along side it while running into it
The normal from get_last_slide_collision() is incorrect, assuming the rest of the collision information is incorrect
This does not happen with the default godot physics engine (Test in Godot 4.3 and Jolt 0.13.0)
The text was updated successfully, but these errors were encountered: