unreal.InputTrigger

class unreal.InputTrigger(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: Object

Base class for building triggers. Transitions to Triggered state once the input meets or exceeds the actuation threshold.

C++ Source:

  • Plugin: EnhancedInput

  • Module: EnhancedInput

  • File: InputTriggers.h

Editor Properties: (see get_editor_property/set_editor_property)

  • actuation_threshold (float): [Read-Write] Actuation Threshold: Point at which this trigger fires

  • last_value (InputActionValue): [Read-Write] Last Value: Value passed to UpdateState on the previous tick. This will be updated automatically after the trigger is updated.

  • should_always_tick (bool): [Read-Write] Should Always Tick: Decides whether this trigger ticks every frame or not.

    • This WILL affect performance and should only be used in specific custom triggers.

property actuation_threshold: float

[Read-Write] Actuation Threshold: Point at which this trigger fires

Type:

(float)

get_trigger_type() TriggerType
Changes the way this trigger affects an action with multiple triggers:

All implicit triggers must be triggering to trigger the action. If there are any explicit triggers at least one must be triggering to trigger the action.

Return type:

TriggerType

is_actuated(for_value) bool
  • Is the value passed in sufficiently large to be of interest to the trigger.

  • This is a helper function that implements the most obvious (>=) interpretation of the actuation threshold.

Parameters:

for_value (InputActionValue) –

Return type:

bool

property last_value: InputActionValue

[Read-Only] Last Value: Value passed to UpdateState on the previous tick. This will be updated automatically after the trigger is updated.

Type:

(InputActionValue)

property should_always_tick: bool

[Read-Only] Should Always Tick: Decides whether this trigger ticks every frame or not.

  • This WILL affect performance and should only be used in specific custom triggers.

Type:

(bool)

update_state(player_input, modified_value, delta_time) TriggerState
This function checks if the requisite conditions have been met for the trigger to fire.
Returns Trigger State None - No trigger conditions have been met. Trigger is inactive.

Trigger State Ongoing - Some trigger conditions have been met. Trigger is processing but not yet active. Trigger State Triggered - All trigger conditions have been met to fire. Trigger is active.

Parameters:
Return type:

TriggerState