Query re: Spawn At Runtine

I’m not I understand the point of adding the Spawn At Runtime parent game object (and associated code).

I get that it keeps the hierarchy tidier when the enemy hit effects get instantiated in the scene; however, since these hit effects almost immediately get destroyed as soon as they’re instantiated, the heirarchy never ends up looking that messy anyway…

Can anyone please explain? Is it more of a “It’s just good practice” thing (than a wholly necessary thing)?

Hi,

You are right. The reason for the parent game object is to keep our Hierarchy tidy. In a little game like ours, it probably does not matter that much how we organise our project.

However, it is usually advisable to start with a good structure that allows us to expand our game at a later juncture. When developing a game or another project, we always want to keep our future self in mind. What if we decide to implement more ideas? Do we get chaos, which is another problem we would have to solve? Or should we invest a couple of seconds to implement a good structure which will (hopefully) prevent chaos?

Long story short, our parent game object is “good practice”. If you have another solution to prevent potential chaos in the Hierarchy, that’s perfectly fine, too. :slight_smile:

Did this answer your question?


See also:

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms