diff options
-rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | scene/2d/collision_shape_2d.cpp | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index 596629f8e8..105ac24950 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -242,9 +242,11 @@ void CollisionShape2DEditor::commit_handle(int idx, Variant &p_org) { } break; case CONCAVE_POLYGON_SHAPE: { + // Cannot be edited directly, use CollisionPolygon2D instead. } break; case CONVEX_POLYGON_SHAPE: { + // Cannot be edited directly, use CollisionPolygon2D instead. } break; case LINE_SHAPE: { diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 88d124536c..d022c857f3 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -176,11 +176,14 @@ String CollisionShape2D::get_configuration_warning() const { if (!Object::cast_to<CollisionObject2D>(get_parent())) { return TTR("CollisionShape2D only serves to provide a collision shape to a CollisionObject2D derived node. Please only use it as a child of Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."); } - if (!shape.is_valid()) { return TTR("A shape must be provided for CollisionShape2D to function. Please create a shape resource for it!"); } - + Ref<ConvexPolygonShape2D> convex = shape; + Ref<ConcavePolygonShape2D> concave = shape; + if (convex.is_valid() || concave.is_valid()) { + return TTR("Polygon-based shapes are not meant be used nor edited directly through the CollisionShape2D node. Please use the CollisionPolygon2D node instead."); + } return String(); } |