Nested game objects

#1

Why I can add game objects inside game objects when i’m editing a collection (first image) and when I’m editing a single game object in a separate file it is not possible (second image)?

And what is the collection purpose if I can use nested game objects?

collection
game object

0 Likes

#2

Collections don’t exist at runtime but they do create relativity between the game objects that are part of them.

Generally use collections as prefabs instead of game objects when you know you need game object parenting, create the prefabs with collection factories. Then you can reference each game object relatively from each other too. So instead head_1 left_arm_1 and head_2 left_arm_2 etc. each go inside of a collection created from a collection factory can all have a head, left_arm etc.

3 Likes

#3

A word of warning here; each collection comes with its own physics world. If you use physics in your game, another approach is to have one game object with factories spawning new game objects into the same physics world.

2 Likes

#4

Only in the case with collection proxies are new distinct physics worlds created, not collection factories.

5 Likes

#5

Oh really? That’s great to know, thanks!

1 Like