Define the unit spawn parameters of opposing Blue and Red agents. Autonomous behaviors enable each side to navigate obstacles and engage via line-of-sight in order to reach a waypoint.
During run-time, autonomous agents navigate around obstacles and engage the opposing side in order to reach a waypoint. It may be possible to add player input in conjunction with the ExampleAgentCommands script and SelectorUI prefab.
Utilize the combat API for your scene by adding the ExampleCombat script and Waypoint_AutoAddToRide prefab.
First, import the Waypoint_AutoAddToRide prefab into your scene.
Note, the ExampleCombat scene places two instances of this object under Floor > SpawnAreas, renaming to “Marineside” and “InsurgentSide”. Recommend giving each a unique name in your scene.
Under the Waypoint Mono script component, ensure Attribute set to “waypoint” and Flags set to “Blue_Spawner” in one object and “Red_Spawner” in the other if re-creating ExampleCombat scene.
Next, add this script to an object in your scene to control the spawn behavior of units. The parameters are as follows:
Last, ensure Blue Spawner and Red Spawner selections match their respective waypoint objects in the scene.