Godot Version
4.3
Question
I’m facing a problem with managing nodes and scene transitions in my project. Here’s a summary of the situation:
Setup:
-
The game is played with a main player character and a ghost
-
The Player and Spirit each have their own components for movement and activation.
-The player and spirit nodes are encapsulated within a parent node called PlayerAndGhost.
-An autoload global script named ControlManager is used to switch control between the Player and Spirit nodes and to update the active camera.
-I made an Area2D node that changes the scene to another PackedScene through an export variable I add through the inspector
Problem:
When running scenes independently, the ControlManager script correctly switches control between Player and Spirit and updates the camera.
However, when transitioning to a new scene where the PlayerAndGhost node is already in, I encounter the following error: Attempt to call function ‘get_node’ in base ‘previously freed’ on a null instance.