summaryrefslogtreecommitdiffstats
path: root/scene/3d/collision_polygon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/collision_polygon.cpp')
-rw-r--r--scene/3d/collision_polygon.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp
index 3b14e1d767..e05f29714b 100644
--- a/scene/3d/collision_polygon.cpp
+++ b/scene/3d/collision_polygon.cpp
@@ -231,6 +231,19 @@ float CollisionPolygon::get_depth() const {
return depth;
}
+String CollisionPolygon::get_configuration_warning() const {
+
+ if (!get_parent()->cast_to<CollisionObject>()) {
+ return TTR("CollisionPolygon only serves to provide a collision shape to a CollisionObject derived node. Please only use it as a child of Area, StaticBody, RigidBody, KinematicBody, etc. to give them a shape.");
+ }
+
+ if (polygon.empty()) {
+ return TTR("An empty CollisionPolygon has no effect on collision.");
+
+ }
+
+ return String();
+}
void CollisionPolygon::_bind_methods() {