Best way to instantiate objects?

Hey guys,

I’ve previously made basic games without game engines and I’m really new to Unity.

I’m confused on a topic. I could create/instantiate path game objects in code and run it through a for loop to create 100 path objects, or I could do it by hand manually dragging prefabs/objects onto the scene.
One difference I can think of using the script method is I won’t be able to see the game objects while the game isn’t running. So to see the scene and how everything looks I’d have to start running the game.

Since I’m new to using engines, I’ve just done it through code but then I probably don’t end up using the engine’s full capabilities maybe? Like I feel like I should be able to see the objects/path down while editing the game to make it easier maybe?

Other than that, what do you guys think is a good way to do it?

Ultimately, whichever is easier for the situation in question.

Typically creating them by hand is better for static objects, especially if you want to hand-tweak their positions or settings, while creating from script might be better for objects that are continuously create and destroyed (e.g. spawning enemies) or depend on parameters you don’t know in advance (e.g. procedurally-generated levels).

2 Likes

Yeah, there really is no right answer since it depends on the scope, your use case, if you want stuff randomized, etc. You need to see what you need for your use case.

1 Like

Thanks for your answers guys!
Yeah so it’s just a board game where pieces walk on tiles/a path (think monopoly) so it would be good to maybe just create them by hand since I won’t be removing them or anything.