Radar Setup

Scene Setup

To set up the scene for target tracking, add a Trackables Scene Manager component anywhere in the scene.

This is a singleton, which means there should only be one in the scene at any time. The Scene Objects prefab already has this component added, so if you have that prefab in your scene you don't need to add it again.

The Trackables Scene Manager gathers information about all the targets in the scene and makes it easy and efficient for the radars on each vehicle to access it.

Vehicle Setup

To set up a vehicle to track targets:

  1. Add a Tracker component to its root transform

  2. Customize the settings in the inspector for radar range, target types, etc

This component will scan target information in the scene based on its search parameters, and store the targets found in a list.

If you wish, you can access the target information in code like so:

// Get the targets list from a Tracker component
List<Trackable> targets = myTracker.Targets;

If you're debugging a problem with target tracking, it's a great idea to go to debug mode (right click at the top of the inspector tab and select Debug) which will make the targets list visible in the inspector of the Tracker component, so you can check if a specific target is being tracked or not.

Last updated