summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-01-18 14:30:07 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-01-18 14:31:07 -0300
commitcc8dfcc9c09381252a5f35198b321c139d8e6569 (patch)
tree57695e81784e92c62cfbed55588d9c47ad4cc765 /scene/3d
parentb3c66de27f1780ed53ac471190e6ca6a5847bf92 (diff)
Before I forget, add warnings on areas without children (should not break anything).
Seen too many users misunderstanding the edit rect is the shape.
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/collision_object.cpp14
-rw-r--r--scene/3d/collision_object.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp
index b246fe75f4..73770a2dd2 100644
--- a/scene/3d/collision_object.cpp
+++ b/scene/3d/collision_object.cpp
@@ -365,6 +365,20 @@ bool CollisionObject::get_capture_input_on_drag() const {
return capture_input_on_drag;
}
+String CollisionObject::get_configuration_warning() const {
+
+ String warning = Spatial::get_configuration_warning();
+
+ if (shapes.empty()) {
+ if (warning == String()) {
+ warning += "\n";
+ }
+ warning += TTR("This node has no children shapes, so it can't interact with the space.\nConsider adding CollisionShape or CollisionPolygon children nodes to define it's shape.");
+ }
+
+ return warning;
+}
+
CollisionObject::CollisionObject() {
capture_input_on_drag = false;
diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h
index c58e02848f..f31d65e411 100644
--- a/scene/3d/collision_object.h
+++ b/scene/3d/collision_object.h
@@ -109,6 +109,8 @@ public:
_FORCE_INLINE_ RID get_rid() const { return rid; }
+ virtual String get_configuration_warning() const;
+
CollisionObject();
~CollisionObject();
};