Skip to content

Commit a1cc379

Browse files
committed
Merge pull request #87126 from ryevdokimov/fix-84424(2)
Fix position and basis of 3D Scenes instantiated via drag and drop
2 parents 3a2fb42 + be0104a commit a1cc379

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/plugins/node_3d_editor_plugin.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -4371,7 +4371,8 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
43714371
}
43724372

43734373
Transform3D new_tf = node3d->get_transform();
4374-
new_tf.origin = parent_tf.affine_inverse().xform(preview_node_pos);
4374+
new_tf.origin = parent_tf.affine_inverse().xform(preview_node_pos + node3d->get_position());
4375+
new_tf.basis = parent_tf.affine_inverse().basis * new_tf.basis;
43754376

43764377
undo_redo->add_do_method(instantiated_scene, "set_transform", new_tf);
43774378
}

0 commit comments

Comments
 (0)