Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
child an object at runtime

adteam43
Registered User
Quote
2021-07-26 17:03:14

I want something this...

I want one object to child in another object with specific key when I pressed and in another key when I pressed I need the the object un-child from the object and set it free without parent or child.

Its possible?


just_in_case
Moderator
Quote
2021-07-26 18:21:47

yes, you can do this with scripting.


var Source = ccbGetSceneNodeFromName("child");
var Link = ccbGetSceneNodeFromName("parent);
ccbSetSceneNodeParent(Source,Link);


use the above code to make a scenenode child of another node. Replace "child" and "parent" with the name of the node you want to make children and parent.

to remove a scenenode from a parent use the below code.


var root = ccbGetRootSceneNode();
var Unlink = ccbGetSceneNodeFromName("child");
ccbSetSceneNodeParent(Unlink,root);


use the above code to remove a scene node from being children of any other node. replace the name "child" with the scene node you want to remove from being children of some other node.

hope that helps


adteam43
Registered User
Quote
2021-07-26 18:23:15

PERFECT JUST IN CASE!!!!!


adteam43
Registered User
Quote
2021-07-26 20:24:48

just-in-case I noticed when the object its "child" or not in "child" changing position.

Is there any script to add to fix the position even the object is a child or not? Runtime of course.
?????


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact