Learn more about combatant-related components.
Combatant Component #
The Combatant Component is automatically added to the object of a combatant. You’ll never add this component manually.
The component’s settings show information about the combatant (e.g. status values, status effects, equipment, etc.) and allows performing some changes (e.g. changing status values/effects, adding items, etc.).
It’s used as a link between the object and the combatant’s instance, e.g. to allow a combatant to be found based on an object.
Combatant Animation Events Component #
Add this component to the prefab of a combatant to be able to use it’s functions in custom scripts or animation events (Unity).
Has the following functions available:
- CalculateCurrentAction()
Calculates the combatant’s current action outcome.
Same as using a Calculate Action node. - CalculateCurrentAction(float damageFactor)
Calculates the combatant’s current action outcome with the provided damage factor.
Same as using a Calculate Action node. - ActivateDamageDealers()
Activates all Damage Dealer components on the combatant.
The damage dealers need to have an action set before activation (e.g. via Set Damage Dealer Action node used in a schematic animating an ability or item). - DeactivateDamageDealers()
Deactivates all Damage Dealer components on the combatant. - CurrentActionActivateDamageDealers()
Activates all Damage Dealer components of the combatant’s current action (have to be set up for auto activation). - CurrentActionDeactivateDamageDealers()
Deactivates all Damage Dealer components of the combatant’s current action (have to be set up for auto activation).
Equipment Viewer Component #
The Equipment Viewer component is used to spawn equipment prefabs on a combatant’s object or change it’s renderer materials.
The equipment viewer will keep track of the equipment of it’s defined equipment slot and spawn it’s viewer prefab (or use the viewer material).
Optionally use conditions to determine if the equipment should be displayed, e.g. only displaying weapons during battles or use different equipment viewers for sheated and drawn weapons.
Add Combatant Component #
Adds a combatant to the object. The object will be used as the combatant instance’s object.
Using the Remember Combatant settings of the component allows to save the combatant’s state, either per scene or globally for all scenes. Otherwise, each time the scene is loaded (or the object instantiated) a new combatant is created.
Combatant Spawner Component #
Spawns combatants in the scene.
The combatants can be spawned at the object’s position, a number of defined objects or at random positions within a defined area.
Defeating combatants of a spawner can cause respawns after a defined time.
Using Scene ID settings of the component allows setting a combatant’s battle state to be finished, blocking spawning again when coming back to the scene.
Using the Remember Combatants settings of the component allows to save the state of the spawned combatants, either per scene or globally for all scenes. Otherwise, each time the scene is loaded (or the object instantiated) new combatants are created.
You can optionally set a Battle component to be used as the place of a battle caused by the spawner’s combatants.
Combatant Despawner Component #
Despawns non-player combatants in the scene, either when being out of range of the player or after a defined time (or both).
The despawner handles all combatants in the scene, e.g. create an empty object and add the Combatant Despawner component to it.
Block Combatant Spawn Component #
Blocks Combatant Spawner components from spawning combatants within the object’s area.
Can also be used if the component’s object or it’s child objects where hit by the raycast finding the spawn position. E.g. add the component at the root of your level’s blocking architecture to prevent combatants from spawing there (game objects still need colliders on them to be able to hit them with the raycast).
Level Zone Component #
Adds a level zone to the scene or a limited area.
Unity: Uses a collider with Is Trigger enabled to define the area.
Level zones can be used by battles, combatant spawners and other combatant creations (e.g. via schematics) to control the levels of newly created combatants.
This is a convenient way to control levels within a scene without having to change level settings of each individual battle or combatant spawner.
Combatant Trigger Component #
Keep track of combatants while they’re within the object’s trigger area Add tags to combatant triggers to define different triggers on a combatant.
Combatant triggers can e.g. be used by the battle AI or move AI to determine targets.
You can use combatant triggers on their own or added to the objects of your combatants (e.g. on their prefab). When they’re added to a combatant, the combatant itself is excluded from being detected by the combatant triggers.
Additionally, combatant triggers also know how long a combatant has been within them – e.g. this can be used to only detect targets for the move AI when they are in the trigger for a defined mount of time.
Tags #
Add tags to combatant triggers to be able to identify different triggers.
E.g. use the tag front for a combatant trigger in the front of the combatant and tag for a trigger in the back of the combatant.
Using Combatant Triggers #
Combatant triggers can be used in different functionality of ORK.
Battle AIs #
The battle AI can select targets that are in the user’s combatant triggers.
You can also check for combatants that are in a combatant trigger for a defined amount of time.
Learn more about the battle AI in this documentation.
Move AIs #
The move AI’s enemy detection can use combatants that are within the user’s combatant triggers.
Optionally this can be limited to combatants that are within the trigger for a defined amount of time.
E.g. immediately detect targets that enter a front combatant trigger, but detect targets in a back trigger only after 2 seconds.
Learn more about the move AIs in this documentation.
Battle Ranges #
Battle ranges are used for use range and affect range target selection in abilities and items.
They can use combatant triggers to select targets, optionally limited to combatants that are within the trigger for a defined amount of time.
E.g. an ability should target all enemies in a 5 world units long area in front of the user.
Set up a combatant trigger for that area and use it’s tag for the battle range.
Learn more about battle ranges in this documentation.
Schematics #
Schematics can check if a combatant is within a combatant trigger (e.g. In Combatant Trigger or Combatant Trigger Time nodes) and use combatants in combatant triggers as selected data (Select Combatant Trigger node).
The schematic nodes can use both combatant triggers added to combatants or set up on their own.
Scripting #
You can also access the combatant triggers of a combatant via scripting:
List<CombatantTriggerComponent> triggers = combatant.Object.Triggers;
The combatant is an instance of the Combatant class, i.e. a combatant in your game.
The Combatant Trigger component has different functions available to get or check combatants within the trigger, check tags, etc.
For using combatant triggers on objects, you can use the regular Unity functionality to get the CombatantTriggerComponent component, e.g.:
CombatantTriggerComponent[] triggers = gameObject.GetComponentsInChildren<CombatantTriggerComponent>();

