unreal.LayeredMoveLogic

class unreal.LayeredMoveLogic(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

Base class for all layered move logic that operates in tandem with instanced FLayeredMoveInstancedData. The logic object itself is not meant to ever be replicated, and a maximum of one instance of each logic class need ever exist on a given MoverComponent. Repeated and/or simultaneous activations of the same move on a component are represented, tracked, and replicated through instances of the FLayeredMoveInstancedData struct type that the logic class indicates in the ActiveMoveDataStructType property.

The virtual methods on this class are invoked in a special and strict pattern that guarantees AccessExecutionMoveData will return the valid data instance relevant to that function execution.

Refer to [Examples when they exist] for implementation examples

C++ Source:

  • Plugin: Mover

  • Module: Mover

  • File: LayeredMoveBase.h

Editor Properties: (see get_editor_property/set_editor_property)

  • default_duration_ms (double): [Read-Write] This move will expire after a set amount of time if > 0. If 0, it will be ticked only once, regardless of time step. It will need to be manually ended if < 0. Note: If changed after starting to a value beneath the current lifetime of the move, it will immediately finish (so if your move finishes early, setting this to 0 is equivalent to returning true from IsFinished())

  • finish_velocity_settings (LayeredMoveFinishVelocitySettings): [Read-Write] Settings related to velocity applied to the actor after the move has finished

  • instanced_data_struct_type (ScriptStruct): [Read-Write] todo: DanH: Fail validation if this isn’t set or isn’t an FLayeredMoveInstancedData

  • mix_mode (MoveMixMode): [Read-Write] Determines how this object’s movement contribution should be mixed with others

  • priority (uint8): [Read-Write] Determines if this layered move should take priority over other layered moves when different moves have conflicting overrides - higher numbers taking precedent.

property default_duration_ms: float

[Read-Write] This move will expire after a set amount of time if > 0. If 0, it will be ticked only once, regardless of time step. It will need to be manually ended if < 0. Note: If changed after starting to a value beneath the current lifetime of the move, it will immediately finish (so if your move finishes early, setting this to 0 is equivalent to returning true from IsFinished())

Type:

(double)

property finish_velocity_settings: LayeredMoveFinishVelocitySettings

[Read-Only] Settings related to velocity applied to the actor after the move has finished

Type:

(LayeredMoveFinishVelocitySettings)

generate_move(time_step, sim_blackboard, start_state, out_proposed_move) ProposedMove or None

Generate a movement that will be combined with other sources

Parameters:
Returns:

out_proposed_move (ProposedMove):

Return type:

ProposedMove or None

property instanced_data_struct_type: ScriptStruct

[Read-Only] todo: DanH: Fail validation if this isn’t set or isn’t an FLayeredMoveInstancedData

Type:

(ScriptStruct)

is_finished(time_step, sim_blackboard) bool

todo:: Will need to cache whether to treat the instance data as const (i.e. whether to disregard & complain if someone tries to set the data in BP during that window)

Parameters:
Return type:

bool

property mix_mode: MoveMixMode

[Read-Only] Determines how this object’s movement contribution should be mixed with others

Type:

(MoveMixMode)

on_end(time_step, sim_blackboard) None

Called when this move has ended

Parameters:
on_start(time_step, sim_blackboard) None

Called when this move is initially activated

Parameters:
property priority: int

[Read-Only] Determines if this layered move should take priority over other layered moves when different moves have conflicting overrides - higher numbers taking precedent.

Type:

(uint8)