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

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

#1

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);


#2

Node must have no parent:

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

#3

Thanks a lot. it worked. :slight_smile:


#4

How can I access a Persist node?


#5

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


#6

It works. Thanks! :slight_smile: