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

Provide warning when using polygon shapes in CollisionShape2D node #40091

Merged
merged 1 commit into from
Jul 3, 2020
Merged

Provide warning when using polygon shapes in CollisionShape2D node #40091

merged 1 commit into from
Jul 3, 2020

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Jul 3, 2020

Closes #21394.

godot-no-polygon-edit

ConvexPolygonShape2D and ConcavePolygonShape2D 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.

`ConvexPolygonShape2D` and `ConcavePolygonShape2D` 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.
@akien-mga akien-mga added cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:editor usability labels Jul 3, 2020
@akien-mga akien-mga added this to the 4.0 milestone Jul 3, 2020
@akien-mga akien-mga merged commit 0148a62 into godotengine:master Jul 3, 2020
@akien-mga
Copy link
Member

Thanks!

@Xrayez Xrayez deleted the polygon-no-mouse-found branch July 3, 2020 15:39
@akien-mga
Copy link
Member

Cherry-picked for 3.2.3.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConvexPolygonShape2D can't be edited with mouse like CollisionPolygon2D
2 participants