WeightTriggerComponent - acrimi/Raven GitHub Wiki

WeightTriggerComponent works in conjunction with TriggerComponent. When the weight of all overlapping entities passes a certain threshold, the entity's TriggerComponent will be automatically activated. If the total weight falls back beneath the threshold, the TriggerComponent will be deactivated.

Configuration

When used inside the components block, the initial state of the component can be configured with the following parameters:

Key Type Description
threshold float The total weight needed to activate the entity's TriggerComponent

Example:

"WeightTriggerComponent": {
  "threshold": 30
}

Properties

The following properties are readable by property accessors (eg render state and persistence definitions):

Key Type Description
currentLoad float The current measured weight of all overlapping entities