Can not be made persist because it's not under root node

Hey Guys,

I am new to Cocos Creator.
I am trying to create a transition from one scene to another
using addPersistRootNode() function. But the console comes up with the message
“The node can not be made persist because it’s not under root node.”

What exactly is the root node and How do i make my node a child of the root node?

Below is the code I use :
onLoad : function:
cc.game.addPersistRootNode(this.node);

Node must have no parent:

this.node.parent = null;
cc.game.addPersistRootNode(this.node);
1 Like

Thanks a lot. it worked. :slight_smile:

How can I access a Persist node?

1 Like

cc.director carries them over to new scene as Canvas node siblings on scene change, so cc.director.getScene().getChildByName('name') should work

2 Likes

It works. Thanks! :slight_smile: