Godot Version
4.4
Question
I am trying to orphan (disconnect from parent) and reparent an Area3D in my game. When I do this the Area3D (and all child geometry moves quite some distance from where it was originally placed).
Oddly if I use a tween like this it works (moves the Area3D back to where it was originally):
var position_tween = create_tween()
position_tween.tween_property(this_module, "position", Vector3(this_module.position.x,this_module.position.y,0.0) , 0.1)
But if I do this it doesn’t:
this_module.position = Vector3(this_module.position.x,this_module.position.y,0.0)
Nothing I’ve tried seems to move the Area3D back to where it was before being orphaned.
I would much prefer to just move the object (using position or similar) instead of hacking it with a tween.
Could anyone please help with working out what’s going on here?
-------------- UPDATE --------------
Now that i’ve added additional objects to it, the tween isn’t even working!
I guess my question is “If I reparent an object how can I get it to STAY PUT? and not move to what seems to be some random location in the world?”
-------------- UPDATE 2 --------------
this_module.reparent(new_parent, true)
and
this_module.reparent(new_parent, false)
Do reparent correctly, however the objects still move far away, and I cannot seem to move them back