Conditions

Conditions are requirements that must be true in order for a trigger to fire. Conditions are quite powerful, as they allow you specify different activities based on the state of the game.

There are four types of conditions:

Condition Type Description Example
Lua Conditions Lua statements that must all evaluate to true. Variable["Credits"] > 50
Quest Conditions A list of quests that must all be in specified states. Quest "Kill 5 Rats" in success or failure state
Accepted Tags A list of tags. The tag of the GameObject that is acting on this trigger must be in the list. If the list is empty, there is no tag condition. "Enemy" (Tag)
Accepted GameObjects A list of GameObjects. The GameObject that is acting on this trigger must be in the list. If the list is empty, there is no GameObject condition. Player (GameObject)

A condition is true only if all of its condition types (Lua, Quest, Tags, and GameObjects) are true.

Conditions are optional. If you don't specify any conditions, the trigger will always fire when triggered.


<< Component Reference