summaryrefslogtreecommitdiff
path: root/scene/2d/remote_transform_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/remote_transform_2d.cpp')
-rw-r--r--scene/2d/remote_transform_2d.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp
index 6dcd980822..4de648a1db 100644
--- a/scene/2d/remote_transform_2d.cpp
+++ b/scene/2d/remote_transform_2d.cpp
@@ -97,6 +97,8 @@ void RemoteTransform2D::set_remote_node(const NodePath& p_remote_node) {
remote_node=p_remote_node;
if (is_inside_tree())
_update_cache();
+
+ update_configuration_warning();
}
NodePath RemoteTransform2D::get_remote_node() const{
@@ -105,6 +107,15 @@ NodePath RemoteTransform2D::get_remote_node() const{
}
+String RemoteTransform2D::get_configuration_warning() const {
+
+ if (!has_node(remote_node) || !get_node(remote_node) || !get_node(remote_node)->cast_to<Node2D>()) {
+ return TTR("Path property must point to a valid Node2D node to work.");
+ }
+
+ return String();
+}
+
void RemoteTransform2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform2D::set_remote_node);