You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a script accesses the global_position of an object instantiated from a packed scene before it's added to the scene tree, and then once added to the scene if its global position is modified by anything (including the physics engine) before its position is modified, it ends up at the origin, regardless of where it's placed in the editor. And for objects instantiated via script, regardless of what its position was set to before adding it with add_child()
The bug does not occur if the object is not a scene instance. Its position is preserved.
Steps to reproduce
instantiate a scene
access its global_position
add it to the scene tree
modify its global position
The text was updated successfully, but these errors were encountered:
reikken
changed the title
Accessing global_position before a scene instance is added to the scene tree can its position to reset to zero
Accessing global_position before a scene instance is added to the scene tree can cause its position to reset to zero
Apr 5, 2023
Hate to necro this one, but I saw this same behavior happen with a Node3D in a pretty bare scene with instanced scenes into a main scene. I positioned the instanced scenes into the main, then on play they all start at Vector zero. This was in 4.1.1 stable.
Godot version
4.0.2
System information
Windows 10
Issue description
If a script accesses the
global_position
of an object instantiated from a packed scene before it's added to the scene tree, and then once added to the scene if its global position is modified by anything (including the physics engine) before itsposition
is modified, it ends up at the origin, regardless of where it's placed in the editor. And for objects instantiated via script, regardless of what itsposition
was set to before adding it with add_child()The bug does not occur if the object is not a scene instance. Its position is preserved.
Steps to reproduce
instantiate a scene
access its global_position
add it to the scene tree
modify its global position
Minimal reproduction project
min.zip
The text was updated successfully, but these errors were encountered: