1. Home
  2. Unity RTS Engine
  3. Buildings
  4. General Building Components

General Building Components

Frontier Collider:

Next thing to do is to add a Collider component to the main building object with “Is Trigger” set to true. This Collider represents the frontiers of the building where no other object (whether it’s a building, resource or any other object). This collider can actually cover more than the building’s model.


Rigidbody:

Add a Rigidbody component to the main building object and Set “Is Kinematic” to true and “Use Gravity” to false.


Audio Source:

Add an Audio Source component to the main building object and make sure that:

  • “Spatial Band” is set to 3D (equal to 1).
  • Under “3D Sound Settings”, set “Doppler Level” and “Spread” both to 0. “Volume Rolloff” should be set to “Linear Rolloff”. And set the “Min Distance” and “Max Distance” to show how loud you want sound coming from the building to be heard from distance.

Navigation Mesh Obstacle:

Add a “Nav Mesh Obstacle” component to the main building object and Set “Carve” to true. Make sure the Navigation Mesh Obstacle size is smaller than the Frontier Collider.

How can we help?