Building System

$4
Publisher ElectorchStrauss
File size 46.05MB
Number of files 264
Latest version 1
Latest release date 2023-12-19 12:03:47
First release date 2022-07-07 10:22:10
Supported Unity versions 2018.4.2 or higher

It's a simple system that most game use.

This packages is suitable for any genre of game.


The Necessary Packages :

The Input System package is necessary for this package to work.

The TextMeshPro package is also necessary.


The Input :

Pressing 1 to 8 while hovering over an item in Mini Inventory selects a construction.

Rotate the xray with "Mouse ScrollWheel". 

Pressing left click will spawn the construction with the xray rotation and position.

You can deselect the selection by right clicking or by pressing the same hotbar shortcut (1-8).

Pressing space bar jumps. 

Press "x" deletes the nearest construction.

Press "v" to change materials. 

Press "h" to hide hud. 

Press "i" to hide mini inventory.

Press "alt" enables to look at the character's face.

Pressing "MMB" creates a forcefield attracting the closest rigidbody from the mouse.


Character controller :

The player no longer moves by directly updating it's transform position. It actually use MoveTowards function to add velocity to the rigidbody based on input. You can change the speed, the acceleration, the shift speed, the air acceleration, the height of a jump, the amount of jump in the air.


The ShowRoom :

There is a ShowRoom to display how a finished home would look like. And also to display how and where all the constructions should be placed. You can add constructions to the ShowRoom or make a completely new structure nearby.


The Favoritism :

You can only place floor first to create a new structure. So you have to place a floor first, then a wall on the floor, then a roof on the wall. You can only place floor on floor, wall on floor, doorway on floor, pillar on floor and corner on floor. You can only place door on doorway. You can only place roof on wall and roof on roof. You can only place stairs on floor and stairs on stairs. This way if a construction does not snap, it won't be able to be instantiated.


The Main Floor :

The main floor is a boolean to check on each construction if the selected xray is the first piece of a new building or if it's snapped to a piece already snapped to a main floor. This way a complete building is parented inside it's nearest main floor making the hierarchy easier to read but you should keep in mind that destroying the nearest construction might destroy the whole building if the nearest construction is the main floor (since all construction snapped on the main floor are child of the nearest main floor).


The Hinge joints :

The doors are working with Hinge joints so you just have to walk into them to "push" them open, kinda like the doors in far west saloon or in some restaurant.


The Torch and BeamLamp both use the hinge joints to make the chain move realistically and add more realism to the system.


There's also a trap door that opens upward.


Itch.io link to test the game

Documentation

Discord answer channel


linktr.ee/electorch

Top Publisher Assets