-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
ShapeCast3D moves when Visible Collision Shapes are enabled #92111
Comments
This looks by design IMO, it shows how far the shape can move before it hits, which is part of how the ShapeCast3D node is designed, I don't think this is a bug but a feature, you can see the code making this happen here: godot/scene/3d/physics/shape_cast_3d.cpp Lines 498 to 515 in daa81bb
|
It's certainly possible that this is by design, but to me it seems very unintuitive and somewhat buggy for several reasons.
|
It doesn't collide and move, it doesn't actually move, the debug is just a debug representation, don't take the visualization to be the real behavior The shape visualizes the closest safe fraction, which is a common use of This is 100% by design, this code didn't happen by accident because it doesn't represent some simulation, it's just a visualization. In the final case where it moves beyond that's due to it not being able to work at the root position, which is possibly a bug in how So while that specific behavior part might be a bug, the fact that it visualizes this way is not an oversight but by design, and displays how the node works and the features of it, you can read the documentation for more details if you have questions on how it works |
I see, thanks. I think I understand now that this is how However, for debugging purposes, would it not make more sense to keep the visual representation of the |
I don't think that makes sense, it doesn't serve any purpose like that IMO, the way it currently works it shows:
Which IMO is exactly the information you want to visualize
This would be cluttered
That could be an idea, but that would have to be handled in a proposal instead So I'd suggest opening a proposal for that part, and the incorrect check at the root position is already tracked in: So closing this, but thank you for your report and conversation! If you're interested in changing the behavior of this please open a proposal to discuss this |
Tested versions
Reproducable in 4.3dev6 and 4.2.1.stable
System information
Godot v4.2.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - integrated Intel(R) UHD Graphics 620 (Intel Corporation; 31.0.101.2111) - Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 Threads)
Issue description
I have added a ShapeCast3D as a child to a CharacterBody3D. When the CharacterBody3D moves, the ShapeCast3D moves with it.
With Visible Collision Shapes enabled, when the ShapeCast3D hits a StaticBody3D the ShapeCast3D does not keep to its original position in relation to its parent, the CharacterBody3D. It seems to get stuck on the StaticBody3D as if it were colliding.
Other CharacterBody3Ds moving into the ShapeCast3D can also move it.
I am not 100% certain but I believe this only affects the Visible Collision Shapes, not the actual ShapeCast3D itself. But it makes debugging hard.
This is a clip showing the issue.
The moving square is a CharacterBody3D, the static square is a StaticBody3D. The rectangle is the ShapeCast3D.
Steps to reproduce
Make a scene with the following structure:
Move the ShapeCast3D position so that it is in front of the CharacterBody3D.
Attach a script to the CharacterBody3D that takes user input to move it around.
Enable Visible Collision Shapes and run the scene. Move the CharacterBody3D so the the ShapeCast3D would collide with the StaticBody3D.
Minimal reproduction project (MRP)
test.zip
The text was updated successfully, but these errors were encountered: