From 7958ceaab80386602e50ef40b989a50ef3e5a9a1 Mon Sep 17 00:00:00 2001 From: Maganty Rushyendra Date: Wed, 30 Dec 2020 11:19:12 +0800 Subject: [PATCH] Fix overwriting of Spatial's local transform Modifies when 'DIRTY_LOCAL' flag is set to prevent a transform applied using `set_transform` to be overwritten by previous calls to change the node's rotation, translation or scale. Fixes #43130. --- scene/3d/spatial.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index c6882e2ed86..6e59be4d377 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -274,6 +274,7 @@ void Spatial::set_global_rotation(const Vector3 &p_euler_rad) { void Spatial::set_transform(const Transform &p_transform) { data.local_transform = p_transform; data.dirty |= DIRTY_VECTORS; + data.dirty &= ~DIRTY_LOCAL; _change_notify("translation"); _change_notify("rotation"); _change_notify("rotation_degrees");