Is this ok to use collection instead of game objects?

I’m doing prototype and have some compound shapes (several sprites combines in different orders with different scales)
And instead of doing this in photoshop I do this in defold editor. this is why for these kind of entities i use collection. (and think later i’ll add some simple tween animations to different parts of my object).

So the question is this a big performance difference with standard game object. which created as separated entities in the editor. As a workaround i can create these objects in spine which will reuse sprites in different places. but honestly i prefer to do that right in editor.

thx.

1 Like

Hi Nicloay,

Yes it’s okay, I asked the same question a while ago and they said the best way to make pre fab objects is making collections, not game objects. I found it a little strange that that was the case, because I understood that collections are for levels, menus, etc. and GO are for things in the collection.

I really wish you could directly change an image’s variables (position, rotation, scale, etc). Then I could do it all with Game Objects.

1 Like

One reason it is superior is that you can only parent GOs to each other (for transforms) when they are inside of a collection.

2 Likes

Remember that collections do not exist at runtime. When the game is running there is only the game objects that exist in the collections. And game objects in themselves are cheap. For complex things such as enemies or the player character and many other things it makes total sense to use collections. I use them all the time.

2 Likes

I just found that it’s not obvious to work with collection data. when you spawn collection instance it returns you set of all game objects. In case if i want to assign new parents to the object i need to know which one is a root object in that collection and it’s sims an issue.