-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Root position of the saved scene (prefab) ignored after drag and drop into new scene #89719
Comments
This is by design, and changing this would break existing projects (assuming the position is taken directly, instead of the action dropping it) See also: |
In this case, it would be nice to display a warning so that users can see that changing the root transform is not recommended because it will be overridden. Otherwise I still consider it a bug. After all, if it is possible to change the root coordinates, and during the preview they are displayed correctly (as an offset relative to the current mouse coordinates), then resetting the coordinates after dragging is completed is not what users expect. Drag and drop must be WYSIWYG. |
Then the part about it using the original offset when drag-dropping is a bug yes, but the bug is that the offset is displayed, not that it isn't applied, as the position is designed to be ignored I'd argue that ignoring the offset (and having a warning) is the appropriate approach, editing with an offset like that is confusing and hard to use IMO, and also creates issues like: |
This is fixed in 4.3 by: #87126 |
MRP behavior in Godot 4.3-dev5: On one side, drag and drop is now WYSIWYG, just like the users expects. Now I can set the offset of the root node and it will work as expected. On the other side, @AThousandShips was against this. But honestly, it’s more convenient for me that the position of the root node of the prefab is taken into account rather than ignored. Therefore, the changes suit me. But I got another bug, I don’t know whether it’s related to this fix or not, but when I drag several prefabs one after another, they are created inside each other. You can see this in the attached GIF. This is not expected behavior. If I need to drag a bunch of different prefabs, I now have to manually deselect the newly-dragged prefab that was automatically selected in the current scene, whereas before (see GIF in the first post) I could just drag prefabs into the scene without thinking about it. |
That behavior was added by: #87623 To make them children of the root node you must hold alt. |
Thanks to everyone, in this case I think the issue can be closed as resolved. |
Tested versions
v4.2.1.stable.official [b09f793]
System information
Godot v4.2.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 with Max-Q Design (NVIDIA; 31.0.15.5186) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)
Issue description
I have a scene with an object (for the sake of convenience I will call it prefab). When I drag a prefab into a new scene - the root position of prefab are ignored after the mouse drag is complete. But during the preview, when I can move the prefab around the scene with the mouse, the preview takes into account the root coordinates.
Visual example:
Root coordinates of my prefab scene:
For the sake of simplicity, I simply moved the sphere up by 0.5m. But during the tests, I discovered that all initial coordinates (XYZ) are ignored.
As you can see, I expect that after releasing the mouse button (complete dragging), the prefab will be in the same place where I currently see it, but it turns out to be in the wrong place.
Currently, as a workaround, I have to create an empty root Node3D with zero coordinates in my prefab scene. But I think that the current behavior is a bug because during the preview everything is displayed correctly.
Steps to reproduce
scene.tscn
from MRP.prefab.tscn
into the open scene using the mouse.Minimal reproduction project (MRP)
PrefabPositionBug.zip
The text was updated successfully, but these errors were encountered: