-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Allow CollisionObject3D to show collision shape meshes #45783
Allow CollisionObject3D to show collision shape meshes #45783
Conversation
ece26ba
to
cf454f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is very welcome! It also allows debug collision shapes to work with CollisionPolygon3D in game, since it creates a shape internally without using CollisionShape3D.
There's a bug with shapes update though. When I try to modify a shape when the game is running, I end up with both shapes being rendered (the old one and the updated one).
It's probably due to the things I commented in _update_debug_shapes
.
Here's my test project:
test-physics-shapes-4.0.zip
cf454f8
to
f6f3a86
Compare
f6f3a86
to
a42a346
Compare
a42a346
to
6b03b85
Compare
Add an editor gizmo to CollisionObject3D. CollisionShape3D no longer shows collision shapes directly.
6b03b85
to
85a776d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
Thanks! |
Right now, it is possible to create custom CollisionShape like nodes through the CollisionObject API.
The only limitation (that I found) is that shapes won't show in editor, and in game with "Visible Collision Shapes" active.
This PR addresses this limitation by allowing CollisionObject (only 3D for now) to show shapes directly.
Related to godotengine/godot-proposals#535.
In the left, a CapsuleShape3D added using CollisionShape3D. In the right, a BoxShape3D added using a script.