ORK Framework Logo - RPG Editor for Unity
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK

Getting Started

  • Introduction
  • First Steps
  • Game Starters
  • Components Overview
  • Player/Camera Controls
  • Game Over

Editor

  • Editor Overview
  • Base/Control Section
  • Game Section
  • UI Section
  • Templates Section
  • Status Section
  • Inventory Section
  • Combatants Section
  • Battles Section

Features

  • Animations
  • Areas & Teleports
  • Combatant Triggers
  • Control Maps
  • Difficulties
  • Factions
  • Formations
  • Formula Nodes
  • Logs
  • Loot
  • Move AI
  • Quests
  • Research Trees
  • Schematic Nodes
  • Shortcut Slots

Status System

  • Status Values
  • Status Effects
  • Attack/Defence Modifiers
  • Abilities
  • Combatants
  • Classes
  • Status Bonuses
  • Status Conditions

Inventory System

  • Inventory System Overview
  • Currencies
  • Items
  • Equipment
  • AI Behaviours/Rulesets
  • Crafting Recipes
  • Shops

Battle System

  • Battle Systems
  • Adding Battles to Scenes
  • Calculating Action Results
  • Battle Menus
  • Battle AI
  • Battle AI Nodes
  • Battle Ranges
  • Battle Camera
  • Target Selection
  • Battle Spots
  • Battle Texts
  • Battle End & Loot Dialogues
  • Action Combos
  • Damage Types
  • Cursor Prefab Components
  • Grid Battles
  • Adding Battle Grids to Scenes
  • Battle Grid Highlights
  • Battle Grid Formations

UI System

  • UI System Overview
  • Start Menu
  • Menu Screens
  • Notifications
  • Combatant Selections
  • Quantity Selections
  • Text Display Settings
  • Cursor Settings
  • Console (In-Game)
  • Menu Requirements
  • HUDs: Content Providers
  • HUDs: Conditions
  • HUDs: Click Actions
  • HUDs: Text Content
  • HUDs: Value Bar Content
  • HUDs: Status Values
  • HUDs: Status Effects
  • HUDs: Attack Modifiers
  • HUDs: Defence Modifiers
  • HUDs: Shortcuts
  • HUDs: Abilities
  • HUDs: Equipment
  • HUDs: Class Slots
  • HUDs: AI Behaviours
  • HUDs: AI Rulesets
  • HUDs: Quests
  • Timebar HUD

Scripting

  • Scripting Overview
  • Access Handler
  • Code Extensions
  • Combatant Scripting
  • Custom Nodes
  • Custom Component Save Data
  • Home
  • Guide
  • Documentation
  • Features
  • Combatant Triggers

Combatant Triggers

Table of Contents
  • Combatant Trigger Components
    • Tags
    • Adding Combatant Triggers
  • Using Combatant Triggers
    • Battle AI
    • Move AI
    • Battle Ranges
    • Schematics
    • Scripting

Use combatant triggers for physical detection of combatants.

Combatant Trigger Components #

Combatant Trigger components are added to the prefabs of your combatants and are used to keep track of other combatants while they’re within their bounds.

They require a collider (2D or 3D) used as trigger (with Is Trigger enabled) – to be able to register combatants, the other combatants also need to have a collider and a rigidbody to enable physics interaction.

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 for a defined mount of time in the combatant trigger.

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.

Adding Combatant Triggers #

Combatant Trigger components need to be added to the game object of a combatant. You’ll usually add them to a combatant’s prefab, but can also be added in-game, e.g. by spawning them as a prefab and parenting them to a combatant.

You can add them as a child object of the combatant’s game object.

Keep in mind that you also need a collider set up as trigger (Is Trigger enabled).

You can easily add a ready-to-use combatant trigger via the scene hierarchy context menu: ORK Framework > Combatant > Combatant Trigger (2D and 3D variants available)

The scene wizard can also create new combatant trigger game objects and add combatant trigger components to existing game objects (2D and 3D variants available).

Using Combatant Triggers #

Combatant triggers can be used in different functionality of ORK.

Battle AI #

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 AI #

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 AI 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 another combatant’s combatant trigger and use combatants in combatant triggers as selected data.

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.

Scripting
Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Updated on May 21, 2022
Table of Contents
  • Combatant Trigger Components
    • Tags
    • Adding Combatant Triggers
  • Using Combatant Triggers
    • Battle AI
    • Move AI
    • Battle Ranges
    • Schematics
    • Scripting
Sitemap
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (59)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (129)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!