Skip to content

Quick Setup

This guide shows you how to add fog of war to your Unity project in a few simple steps.

Setup Steps

1. Create the Scene

  1. Create a new scene
  2. Create a plane: GameObject > 3D Object > Plane
  3. Scale it to your desired map size (e.g., scale 10, 1, 10 for a 100×100 world)

2. Create a Sub-Scene

The system uses Unity DOTS, which requires a sub-scene:

  1. Create an empty GameObject
  2. Right-click it and select New Sub Scene > Empty Scene...
  3. Name it "GameWorld"

3. Add FogOfWarManager

  1. In the main scene, create an empty GameObject named "FogOfWarManager"
  2. Add the FogOfWarManager component
  3. Set the map bounds to match your plane:
  4. For a 100×100 plane: Left -50, Right 50, Bottom -50, Top 50

4. Add a Unit with Vision

Inside the sub-scene:

  1. Create a GameObject (your unit)
  2. Add VisionSourceAuthoring component
  3. Set Scale to (10, 10) for a 10-unit vision radius

5. Test

Enter Play Mode. You should see fog covering everything except around your unit.