From 88e3ba83f0d80a88771afcb9ee5597bcfcf1a2d0 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 14 Sep 2021 17:46:39 +0800 Subject: [PATCH] Make sure IK target is inside tree before using its transform --- scene/3d/skeleton_ik_3d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/3d/skeleton_ik_3d.cpp b/scene/3d/skeleton_ik_3d.cpp index a8915666331..466f67afb8c 100644 --- a/scene/3d/skeleton_ik_3d.cpp +++ b/scene/3d/skeleton_ik_3d.cpp @@ -542,7 +542,7 @@ Transform3D SkeletonIK3D::_get_target_transform() { target_node_override = Object::cast_to(get_node(target_node_path_override)); } - if (target_node_override) { + if (target_node_override && target_node_override->is_inside_tree()) { return target_node_override->get_global_transform(); } else { return target;