How to duplicate specific object

10 January 2019 18:44
How to make a button that would allow the viewer to duplicate and object and its naterial?
Or copy and paste? Whichever..
Is it possible with logic nodes? Anyone?
10 January 2019 20:06
With the API method for copying objects: m_objects.copy()

With Logic Nodes, you can either use a JS_Callback Node that executes the above-mentioned copy method.

Or you can use a trick: You already start with hidden copies of the object and upon user click, you use Transform, Inherit Material and Show nodes to place the copy. (But this will not be a feasible solution if the user is supposed to make many or even unlimited copies.)
15 January 2019 04:14
Awesome. Thank you so much for your help. any example of api youve seen around and link it so i could see it in the code?
15 January 2019 10:05
I forgot to mention dynamic asset loading with m_data.load(). This is apparently used in the cartoon interior example - every click on a furniture button loads the respective asset, so three clicks on the chair button create three chairs, and it's efficient because it only loads on demand.
Please register or log in to leave a reply.