Skip to content
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

Phantom Camera disappears when re-adding a scene to a tree #253

Open
Paul-Griffin-1517-1 opened this issue Apr 18, 2024 · 0 comments
Open

Comments

@Paul-Griffin-1517-1
Copy link

Issue description

In my game, there is a PhantomCamera3D attached to the player and saved as a variable. At one point, the player is removed from the tree, but not freed. At a later point, the player is re-added to the tree.
At this point, the variable that referenced the PhantomCamera3D becomes null, and it becomes difficult to re-assign the variable PhantomCamera3D.
At the very least, it would be good to have an easy way to reassign the variable, since using the node's path (like in the @onready declaration) doesn't work at this point.

Steps to reproduce

Add a node with a PhantomCamera3D child.
In a script on the node, create an @onready variable called phantom_camera that equals the PhantomCamera3D.
Remove the node from the tree.
Re-add the node from the tree.
The phantom_camera variable will be empty.

(Optional) Minimal reproduction project

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant