Hi all. I have an object what will be shown on all scenes of the game (the top status panel).
So I decided to use it as Persistent Node.
I added it to the game:
game.addPersistRootNode(persistRootNodeTopPanel);
and stored it in my global variable for persistent nodes:
persistRootNodes.topPanel = persistRootNodeTopPanel;
And then change the scene… I am trying to add my top panel to the container in the scene:
protected onLoad() {
const { topPanelPersistRootNodeContainer, node } = this;
const topPanelPersistRootNode = persistRootNodes.topPanel;
topPanelPersistRootNodeContainer.addChild(topPanelPersistRootNode);
topPanelPersistRootNode.active = true;
}
then I am getting error:
I am wondering if persistent nodes can change the parent? Thanks.