Description
Tested versions
Reproducible in: 4.3.dev [2d0ee20], 4.2.1.stable, 4.1.3.stable, 4.0.4.stable
System information
Godot v4.2.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - RX 7800 XT - i5-13600K
Issue description
When you have a SoftBody3D node with pinned points in your scene and you reload the scene using get_tree().reload_current_scene()
or by loading a different scene and then loading back to the first scene, the pinned points become displaced in the reloaded scene and the following error is printed twice for each pinned point:
E 0:00:01:0421 get_global_transform: Condition "!is_inside_tree()" is true. Returning: Transform3D()
<C++ Source> scene/3d/node_3d.cpp:343 @ get_global_transform()
This issue is similar to the problem reported in #54780, but the reproduction project in that issue is more complex and throws more errors, plus it's originally from Godot 3.4, so I'm creating this issue for the more straightforward case of simply having a SoftBody3D with pinned points and reloading current scene.
Steps to reproduce
- Open MRP and run the game
- Use A / D to rotate the cube and verify that the soft body has pinned points working properly
- Press Space to trigger
get_tree().reload_current_scene()
- See that now the pinned points are clearly displaced and above mentioned errors were thrown
Minimal reproduction project (MRP)
MRP for 4.2: softbody_issue_4.2.zip
MRP for 4.0 and 4.1: softbody_issue_4.1.zip