Closed jogly closed 1 month ago
This looks like a case where logic in the _exit_tree()
function is called, which tries to communicate with PCamHost
. Which it really shouldn't, given everything is exiting the tree when changing scene.
Think there's a more systemic checker that could be put in place to guard against this.
Appears to be solved from changes in #267
Issue description
When switching scenes the Phantom Camera view finder dock tries to make the new scene's PCam3D active, but uses the old scene's Camera3D (via the old scene's PCamHost) if the new scene does not have a PCamHost. This means calling
get_global_transform
onCamera3D
when it is not in the current scene tree which results in the following editor error:I was able to remove the error by checking if the camera3d is inside the tree before considering it in
addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd#128
but the real fix should patch the viewfinder logic to clean up on scene switching so it doesnt even try to update the old PCamHost.
Steps to reproduce
Two scenes:
Switching from (1) to (2) should print the erorr.
(Optional) Minimal reproduction project
No response