A simple Modular Building System for Unity 3D
In the repo you will find a Unity Package. The package contains all scripts, models, and prefabs that I used to build the system in the tutorial video.
Below you will find a quick guide on how to set up your models. Remember you will need 2 different models for each thing you want to build. One will be the actual model you player can walk on and interact with in your game. The other will be the "preview" that the player can position in your game.
-You will need to make a different Tag for each snap point type, such as Foundation_SnapPoints, Wall_SnapPoints.....
-Create a new layer for you preview gameobject. This is important and if you skip this step it will glich out
SphereCollider -> Radius = 0.25
SphereCollider -> IsTrigger = True
-Just add a material so it stands out(if using a primitive)
-No tag
-No layer
Layer -> Set it to somthing like BuildLayer(or whatever you want it to be)
Box Collider -> IsTrigger = True
Rigidbody -> useGravity = False
Rigidbody -> isKinematic = true
Add the Preview Script
Create an empty and add in the BuildSystem, and the BuildManager
The BuildManager script is optional. In your game the BuildManager.cs will be replaced by your Inventory, HotBar, or someother source.