Radar Setup
Last updated
Last updated
To set up the scene for target tracking, add a Trackables Scene Manager component anywhere in the scene.
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.
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.
To set up a vehicle to track targets:
Add a Tracker component to its root transform
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:
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.