Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
How does one identify a specific cloned node and delete it? |
||||
|
I think its better to change the name of the cloned node and give a name unique to each cloned object or number it like this: Object1, Object 2, Object 3, etc... This way, I think it would be easier to identify the nodes. To delete the node, just use "Delete Scene Node" action of CopperCube and click the node you want to delete and you can also set a specific time of deletion if you want. |
||||
|
Hi, thanks for the response.... but I would like to delete the node via javascript by identifying the specific node. Is there a way of identifying the node through code? |
||||
|
Chester wrote: Hi, thanks for the response.... but I would like to delete the node via javascript by identifying the specific node. Is there a way of identifying the node through code? if you clone node and set its name as dynamogames mentioned.. then you can delete any of them with code by getting its ID by name.. var s = ccbGetSceneNodeFromName("Object1"); ccbRemoveSceneNode(s ); you can get all of them by using FOR loop. FOR i=first TO max var s = ccbGetSceneNodeFromName("Object" +i); ccbRemoveSceneNode(s ); NEXT |
||||
|
Here's an example file of me changing the name of a cloned node and identifying it on click. All you need to do is run the project and click the cubes to see their names. Then you can use the ccbRemoveSceneNode() like Sven mentions. Without any more details as to what you are actually doing it's kind of hard to answer this question. I can think of other ways to do this, too. https://files.catbox.moe/wygis7.... |
||||
|
Tnx! |
|