Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / LoadObject for each instance or LoadObject then clone?

Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 3rd Jan 2022 08:24
Is it fast to use loadobject for each instance of my cubes or should I set it up to load one object as a temp then clone it for each instance? If I load an object as a temp though won't each clone be deleted when I delete the main one?
Win 10 Pro - AMD RYZEN 9 3950X 64GB DDR4 - RTX 2080 SUPER
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Jan 2022 09:01
When using CloneObject(), each clone is an entirely new object. Deleting the origional will have no effect on the clone.
InstanceObject() will create an "instance" of the primary object and deleting the primary object will cause a crash
AGK Tool Maker
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 4th Jan 2022 08:56
I personally go with instancing because it renders faster, I use template objects when doing this

Create a box, call it a template then instance from that, the template is never used in-game so avoiding accidentally deleting and crashing, simply place the template at the required location/rotation instance and hide the template
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Bored of the Rings
User Banned
Posted: 4th Jan 2022 09:43
@PTC-spot on
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others

Login to post a reply

Server time is: 2023-12-05 11:41:26
Your offset time is: 2023-12-05 11:41:26