1. Home
  2. Docs
  3. AI Toolkit
  4. Targeting

Targeting

VisAI System - Targeting

VisAI’s Targeting System was designed to give AI a way to handle multiple targets at once in a logical way. The system can be used for things such as targeting multiple enemies for attack, creating “Queued Actions”, or some other way you find use for it. 

Targeting is integrated with the Relationship & Perception Systems, and with the change of a setting, your AI will target enemies on sight. You can also manually add and remove targets for things such as the Action Queue System described above.

The Features

In the Targeting System, you’ll find things like Targeting Enemies on Sight, Main & Current Target(s), and more. Take a look at the list below to learn more about what the system has to offer. 

All Systems

  • Replicated
  • Modular
  • Optimized
  • Easy to Customize & Expand
  • Various Functions & Events to assist you during development

This System

  • Auto Target Enemies on Sight
  • Auto Target Cleanup (On invalid reference or custom)
  • Main & Current Target(s)
  • Auto Assign Main Target

System Location: VisAI_Controller

The system provides powerful features that are easy to use. Look through the options available to you and consider how you could use them with your AI. Chances are, you’ll find something that you don’t have to spend time building yourself.

Learn how to modify systems by checking out this page here.

VisAI - Settings
Targeting Update Time Setting - This determines how often the controller will check to see if targets are still valid. If not, it will remove them from the target array.
Target Enemies on Sight Setting - Boolean to control if the Enemies will be targeted on sight.
VisAI - Data
Current Targets Data - Array of references to current targets.
Main Target Data - Variable to represent the current main target.
VisAI - Events
Set Main Target Event - Set the main target, takes in the target object and the object marked as enemy.
VisAI - Functions
Has Valid Target Actor Function - Checks to see if the AI has a valid enemy in the blackboard.
Is Current Target in Sight Function - Checks the blackboard to see if the current enemy is in sight.
Get Distance to Main Target Function - Get the distance to the main target.
Get Nav Distance to Main Target Function - Gets the nav distance to the main target.
Get Nearest Target Function - Gets the Nearest Target, and Returns it.
Is Actor Enemy or Target Function - Takes a character, checks it's class, and compares it to the "Enemy Types" setting variable in the blueprint. Returns true if the target is an enemy.
Is Actor Target Function - Checks the Actor and returns true if the actor is a target.
Any Targets Function - Returns true if there are any targets in the objects checked.
Get Nearest Target in Sight Function - Gets the nearest target in sight and returns it.

Articles

How can we help?