Jump to content

NodeReferences in 2.15


photo

Recommended Posts

Posted (edited)

Hi!

We use NodeReferences as a template for our objects and delete them after we are done with them. We do this repeatedly during the gameplay. In Unigine 2.10, we could do that numerous times. But in 2.15, when we delete the NodeReference once, the nodes or objects inside the NodeReference are gone forever (lose the reference) and we can't use them anymore. Hence, we get a bunch of errors. Is there a trick to this, maybe is there a way to create a copy?

Thanks.

Edited by tolga
Posted

Hi tolga,

"When we delete the NodeReference once, the nodes or objects inside the NodeReference are gone forever"
Sounds like normal behavior. Could you provide a small sample with that problem?

Best regards,
Alexander

Posted

Here's a simple example:

String path = "the path to node reference";

NodeReferencePtr node1 = NodeReference::create(path);
// Do stuff with the objects inside.
node1.deleteForce();
node1.clear();

NodeReferencePtr node2 = NodeReference::create(path);
// Try to do stuff with the objects inside.
// KABOOOM!

Hope it helps.

×
×
  • Create New...