[SOLVED] Remove child entity make entity not show

I am new to playcanvas

and I have question remove child make entity not show at the scene but it is not destory

is there way to re-enable it or show?

// code here

        var p = spawnedEntites[1].parent;

        p.removeChild(spawnedEntites[1]);

        this.app.root.getChildren()[0].addChild(spawnedEntites[1]);

        if (spawnedEntites[1].parent)
        {
           spawnedEntites[1].setPosition(Math.floor(Math.random() * 3), Math.floor(Math.random() * 3), Math.floor(Math.random() * 3));
        console.log("My Parent : " + spawnedEntites[1].parent.name);        
}

Hi @SamSam_Hong and welcome!

Are you sure getChildren() is a PlayCanvas API?

Maybe you can try to replace line 7 with the code below.

this.app.root.children[0].addChild(spawnedEntites[1]);

oh i did not notice that

I will change to children

Thank you for helping