TriggerData

objects.

Inherit:
GameBaseData

Description

Defines shared properties for Trigger objects.

The primary focus of the TriggerData datablock is the callbacks it provides when an object is within or leaves the Trigger bounds.

Methods

void TriggerData::onEnterTrigger(Trigger trigger, GameBase obj)

Called when an object enters the volume of the Trigger instance using this TriggerData .

Parameters:
  • trigger – the Trigger instance whose volume the object entered
  • obj – the object that entered the volume of the Trigger instance
void TriggerData::onLeaveTrigger(Trigger trigger, GameBase obj)

Called when an object leaves the volume of the Trigger instance using this TriggerData .

Parameters:
  • trigger – the Trigger instance whose volume the object left
  • obj – the object that left the volume of the Trigger instance
void TriggerData::onTickTrigger(Trigger trigger)

Called every tickPeriodMS number of milliseconds (as specified in the TriggerData ) whenever one or more objects are inside the volume of the trigger. The Trigger has methods to retrieve the objects that are within the Trigger’s bounds if you want to do something with them in this callback.

Parameters:trigger – the Trigger instance whose volume the object is inside

Fields

bool TriggerData::clientSide

Forces Trigger callbacks to only be called on clients.

int TriggerData::tickPeriodMS

Time in milliseconds between calls to onTickTrigger() while at least one object is within a Trigger’s bounds.