I’m still new to Unity and self taught so I’m having a hard time tracking something down even after hours of research so hopefully someone can answer this here.
How do I set up my game to allow the player to create their in game (non-mod) construction. Examples
of this would be the ability of any player to create structures like in ARK or Fallout 4. I’ll even toss 7 Days
to Die in although that construction is most likely (I assume) somewhat different.
I want the player to be able to create foundations, walls, ceilings, stairs, windows, book shelves etc. and
I want the player to be able to create exactly as they wish. Skyrim is what I DON’T want. Skyrim had
a list of pre-fabs in game that you could choose from and then “build”. I want the player to have complete
control. Another example of what I want would be Night of the Dead with the ability to do the above including
building construction benches, defenses etc.
A foundation, wall or piece of furniture, once placed, is just a static object prefab in the world. You can just spawn those with Instantiate, except you need to write scripting to determine valid placement and perform snapping. You’ll also need to store their positions in a save file and rebuild them once the game is loaded. And that’s pretty much it.
Inside the game, basically, construction goes like this:
When placement start, spawn a “ghost” object.
Have scripts that determine ghost’s valid placement and snapping.
If the user tries to place an object while placement is valid, spawn the prefab into the world with Instantiate at coordinates of the ghost, and prehaps record its position somewhere.
Also, you only need to record where your objects are if you’re doing some sort of conveyer system like space engineers.
Another thing is that with more complex construction you’d need to perform optimizations.
There are some assets in Asset Store to check (even free one exists!).
personal opinion here
But in general it’s only about spawning assets or parts of those - there no in-game 3D modelling software (and for a good reason - players need a game to have fun, not a Blender/3Dsmax/Maya huge interface with tons of menus and hotkeys to learn to achieve … what?). Simple stuff (like terrain building) probably will be nice to have, but if creation of content is harder than Minecraft block placement - it wont work for players, creating 3D stuff is hard and not so rewarding process… I’m personally making ray-tracing sandbox game but it’s still only about placing existing library of assets and their parts and modifying them (material replacement, playing with lights, scale/move/rotate/delete stuff).
Check out what’s happened with Sony project “Dreams” in the end as example… /personal opinion
This lead me exactly to what I needed. Unity assets is all about finding the key magic words to get results at times
and the words are “In game Building System” or “In game Modular Building System” and your pack linked me to the
goldmine!