Provide warning when using polygon shapes in CollisionShape2D
node
#40091
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #21394.
ConvexPolygonShape2D
andConcavePolygonShape2D
are only meant to be used directly in code and not in the editor for physics-based use cases specifically.Developers are advised to use
CollisionPolygon2D
instead, which does generate those shapes under the hood, handling polygon convexivity, proper orientation etc.This change is advised by @reduz with the discussion in #21394 (comment).
For enthusiasts, you can check out how I'd go for simple polygon editing in goostengine/goost#2 implementing
VisualShape2D
node, with the use cases not necessarily related to physics. But given such a node likely won't be available in Godot due to #16483 (comment), it doesn't make much sense to provide an editor to edit polygon-based shapes, as there's no benefit doing so for physics-only use cases.