Jump to content

[SOLVED] Node clone deletes with cloned one?


photo

Recommended Posts

Hello!

I need to load node, add its child to editor and delete parent and other childs. I'm using code like this:

Node firstChild;
Node node = engine.world.loadNode( "some.node" );
if( node.getNumChilds() > 0 )
{
 firstChild = node_clone( node.getChild( 0 ) );
 node_delete( node_append( node ) );
 // firstChild == NULL now!
}
else
{
 firstChild = node;
}

engine.editor.addNode( firstChild );

 

What do I do wrong? Thanks!

Link to comment
×
×
  • Create New...