unreal.MoverComponent

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

Bases: ActorComponent

Mover Component

C++ Source:

  • Plugin: Mover

  • Module: Mover

  • File: MoverComponent.h

Editor Properties: (see get_editor_property/set_editor_property)

  • accept_external_movement (bool): [Read-Write] If enabled, we’ll accept any movements from an external system in the next simulation state update

  • asset_user_data (Array[AssetUserData]): [Read-Write] Array of user data stored with the component

  • asset_user_data_editor_only (Array[AssetUserData]): [Read-Write] Array of user data stored with the component

  • auto_activate (bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.

  • backend_class (type(Class)): [Read-Write] Specifies which supporting back end class should drive this Mover actor

  • can_ever_affect_navigation (bool): [Read-Write] Whether this component can potentially influence navigation

  • component_tags (Array[Name]): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • editable_when_inherited (bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor class

  • gather_input_from_all_input_producer_components (bool): [Read-Write] If true, any actor component implementing MoverInputProducerInterface on this component’s owner will be able to produce input commands

  • gravity_accel_override (Vector): [Read-Write] cm/s^2, only meaningful if bHasGravityOverride: is enabled.Set SetGravityOverride:

  • gravity_to_world_transform (Quat): [Read-Only] A cached quaternion representing the inverse rotation from world space to gravity relative space defined by GravityAccelOverride.

  • has_gravity_override (bool): [Read-Write] Whether or not gravity is overridden on this actor. Otherwise, fall back on world settings. See SetGravityOverride:

  • has_up_direction_override (bool): [Read-Write] Whether to override the up direction with a fixed value instead of using gravity to deduce it

  • input_producer (Object): [Read-Write] Optional object for producing input cmds. Typically set at BeginPlay time. If not specified, defaulted input will be used.

    Note that any other actor component implementing MoverInputProducerInterface on this component’s owner will also be able to produce input commands if bGatherInputFromAllInputProducerComponents is true.

    see: bGatherInputFromAllInputProducerComponents

  • is_editor_only (bool): [Read-Write] If true, the component will be excluded from non-editor builds

  • movement_mixer (MovementMixer): [Read-Write] Optional object for mixing proposed moves.Typically set at BeginPlay time. If not specified, UDefaultMovementMixer will be used.

  • movement_modes (Map[Name, BaseMovementMode]): [Read-Write]

  • on_component_activated (ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivated

  • on_movement_mode_changed (Mover_OnMovementModeChanged): [Read-Write] Broadcast when a MovementMode has changed. Happens during a simulation tick if the mode changed that tick or when SetModeImmediately is used to change modes.

  • on_movement_transition_triggered (Mover_OnTransitionTriggered): [Read-Write] Broadcast when a Transition has been triggered.

  • on_post_finalize (Mover_OnPostFinalize): [Read-Write] Broadcast after each finalized simulation frame, after the state is finalized. (Game thread only)

  • on_post_simulation_rollback (Mover_OnPostSimRollback): [Read-Write] Broadcast when a rollback has occurred, just before the next simulation tick occurs

  • on_post_simulation_tick (Mover_OnPostSimTick): [Read-Write] Broadcast after each simulation tick and the state is finalized

  • on_pre_movement (Mover_OnPreMovement): [Read-Write] Broadcast during the simulation tick after inputs have been processed, but before the actual move is performed. Note - When async simulating, the delegate would be called on the async thread, and might be broadcast multiple times.

  • on_pre_simulation_tick (Mover_OnPreSimTick): [Read-Write] Broadcast before each simulation tick. Note - Guaranteed to run on the game thread (even in async simulation).

  • on_teleport_failed (Mover_OnTeleportFailed): [Read-Write] Broadcast when a teleport has failed

  • on_teleport_succeeded (Mover_OnTeleportSucceeded): [Read-Write] Broadcast when a teleport has succeeded

  • persistent_sync_state_data_types (Array[MoverDataPersistence]): [Read-Write] List of types that should always be present in this actor’s sync state

  • planar_constraint (PlanarConstraint): [Read-Write] Settings that can lock movement to a particular plane

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Main tick function for the Component

  • replicate_using_registered_sub_object_list (bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.

  • replicates (bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

  • shared_settings (Array[Object]): [Read-Write] Collection of settings objects that are shared between movement modes. This list is automatically managed based on the MovementModes: contents.

  • smoothing_mode (MoverSmoothingMode): [Read-Write] If enabled, the movement of the primary visual component will be smoothed via an offset from the root moving component. This is useful in fixed-tick simulations with variable rendering rates.

  • starting_movement_mode (Name): [Read-Write] Name of the first mode to start in when simulation begins. Must have a mapping in MovementModes. Only used during initialization.

  • supports_kinematic_based_movement (bool): [Read-Write] If enabled, this actor will be moved to follow a base actor that it’s standing on. Typically disabled for physics-based movement, which handles based movement internally.

  • sync_inputs_for_sim_proxy (bool): [Read-Write] If enabled, we’ll send inputs along with to sim proxy via the sync state, and they’ll be available via GetLastInputCmd. This may be useful for cases where input is used to hint at object state, such as an anim graph. This option is intended to be temporary until all networking backends allow this.

  • transitions (Array[BaseMovementModeTransition]): [Read-Write] Transition checks that are always evaluated regardless of mode. Evaluated in order, stopping at the first successful transition check. Mode-owned transitions take precedence. */

  • up_direction_override (Vector): [Read-Write] A fixed up direction to use if bHasUpDirectionOverride is true

  • use_deferred_group_movement (bool): [Read-Write] If true, then the transform updates applied in UMoverComponent::SetFrameStateFromContext will use a “deferred group move” to improve performance.

    It is not recommended that you enable this when you need exact, high fidelity characters such as your player character. This is mainly a benefit for scenarios with large amounts of NPCs or lower fidelity characters where it is acceptable to not have immediately applied transforms.

    This only does something if the “s.GroupedComponentMovement.Enable” CVar is set to true.

  • warn_on_external_movement (bool): [Read-Write] Whether to warn when we detect that an external system has moved our object, outside of movement simulation control

  • world_to_gravity_transform (Quat): [Read-Only] A cached quaternion representing the rotation from world space to gravity relative space defined by GravityAccelOverride.

property accept_external_movement: bool

[Read-Write] If enabled, we’ll accept any movements from an external system in the next simulation state update

Type:

(bool)

add_gameplay_tag(tag_to_add) None

Adds a gameplay tag to this Mover Component. Note: Duplicate tags will not be added

Parameters:

tag_to_add (GameplayTag) – Tag to add to the Mover Component

add_gameplay_tags(tags_to_add) None

Adds a series of gameplay tags to this Mover Component Note: Duplicate tags will not be added

Parameters:

tags_to_add (GameplayTagContainer) – Tags to add/append to the Mover Component

add_movement_mode_from_class(mode_name, movement_mode) BaseMovementMode

Add a movement mode to available movement modes. Returns true if the movement mode was added successfully. Returns the mode that was made.

Parameters:
Return type:

BaseMovementMode

add_movement_mode_from_object(mode_name, movement_mode) bool

Add a movement mode to available movement modes. Returns true if the movement mode was added successfully

Parameters:
Return type:

bool

bind_process_generated_movement(process_generated_movement_event) None

Binds event for processing movement after it has been generated. Allows for final modifications to proposed movement before it’s executed.

Parameters:

process_generated_movement_event (Mover_ProcessGeneratedMovement)

cancel_features_with_tag(tag_to_cancel, require_exact_match=False) None

Cancel any active or queued movement features (layered moves, modifiers, etc.) that have a matching gameplay tag. Does not affect the active movement mode.

Parameters:
cancel_modifier_from_handle(modifier_handle) None

Cancel any active or queued Modifiers with the handle passed in.

Parameters:

modifier_handle (MovementModifierHandle)

find_movement_mode(movement_mode) BaseMovementMode

Find Movement Mode

Parameters:

movement_mode (type(Class))

Return type:

BaseMovementMode

find_movement_mode_by_name(movement_mode_name) BaseMovementMode

Find Movement Mode by Name

Parameters:

movement_mode_name (Name)

Return type:

BaseMovementMode

find_shared_settings_bp(shared_setting) Object

Find settings object by type. Returns null if there is none of that type

Parameters:

shared_setting (type(Class))

Return type:

Object

find_shared_settings_mutable_bp(shared_setting) Object

Find mutable settings object by type. Returns null if there is none of that type

Parameters:

shared_setting (type(Class))

Return type:

Object

property gather_input_from_all_input_producer_components: bool

[Read-Only] If true, any actor component implementing MoverInputProducerInterface on this component’s owner will be able to produce input commands

Type:

(bool)

get_base_visual_component_transform() Transform

Gets BaseVisualComponentTransform used for cases where we want to move the visual component away from the root component. See BaseVisualComponentTransform:

Return type:

Transform

get_future_trajectory(future_seconds, samples_per_second) Array[TrajectorySampleInfo]

Get Future Trajectory

Parameters:
  • future_seconds (float)

  • samples_per_second (float)

Return type:

Array[TrajectorySampleInfo]

get_gravity_acceleration() Vector

Get the current acceleration due to gravity (cm/s^2) in worldspace

Return type:

Vector

get_last_input_cmd() MoverInputCmdContext

Access the most recently-used inputs.

Return type:

MoverInputCmdContext

get_last_time_step() MoverTimeStep

Get the most recent TimeStep

Return type:

MoverTimeStep

get_movement_base() PrimitiveComponent

Get the current movement base. Null if there isn’t one.

Return type:

PrimitiveComponent

get_movement_base_bone_name() Name

Get the current movement base bone, NAME_None if there isn’t one.

Return type:

Name

get_movement_intent() Vector

Get the intended movement direction in worldspace with magnitude (range 0-1)

Return type:

Vector

get_movement_mode() BaseMovementMode

Get the current movement mode

Return type:

BaseMovementMode

get_movement_mode_name() Name

Get the current movement mode name

Return type:

Name

get_planar_constraint() PlanarConstraint

Access the planar constraint that may be limiting movement direction

Return type:

PlanarConstraint

get_predicted_trajectory(prediction_params) Array[TrajectorySampleInfo]

Get a sampling of where the actor is projected to be in the future, based on a current state. Note that this is projecting ideal movement without doing full simulation and collision. The first sample info of the returned array corresponds to the current state of the mover.

Parameters:

prediction_params (MoverPredictTrajectoryParams)

Return type:

Array[TrajectorySampleInfo]

get_primary_visual_component() SceneComponent

Access the primary visual component of the actor

Return type:

SceneComponent

get_sim_blackboard() MoverBlackboard

Access the read-only version of the Mover’s Blackboard

Return type:

MoverBlackboard

get_sync_state() MoverSyncState

Access the most recent captured sync state.

Return type:

MoverSyncState

get_target_orientation() Rotator

Get the orientation that the actor is moving towards

Return type:

Rotator

get_up_direction() Vector

Get the normalized direction considered “up” in worldspace. Typically aligned with gravity, and typically determines the plane an actor tries to move along.

Return type:

Vector

get_updated_component() SceneComponent

Access the root component of the actor that our Mover simulation is moving

Return type:

SceneComponent

get_velocity() Vector

Get the current velocity (units per second, worldspace)

Return type:

Vector

property gravity_to_world_transform: Quat

[Read-Only] A cached quaternion representing the inverse rotation from world space to gravity relative space defined by GravityAccelOverride.

Type:

(Quat)

handle_impact() MoverOnImpactParams

Handle a blocking impact.

Returns:

impact_params (MoverOnImpactParams):

Return type:

MoverOnImpactParams

has_gameplay_tag(tag_to_find, exact_match) bool

Check Mover systems for a gameplay tag.

Parameters:
  • tag_to_find (GameplayTag) – Tag to check on the Mover systems

  • exact_match (bool) – If true, the tag has to be exactly present, if false then TagToFind will include it’s parent tags while matching

Returns:

True if the TagToFind was found

Return type:

bool

has_gameplay_tag_in_state(sync_state, tag_to_find, exact_match) bool

Check Mover systems for a gameplay tag. Use the given state, as well as any loose tags on the MoverComponent.

Parameters:
  • sync_state (MoverSyncState)

  • tag_to_find (GameplayTag) – Tag to check on the MoverComponent or state

  • exact_match (bool) – If true, the tag has to be exactly present, if false then TagToFind will include it’s parent tags while matching

Returns:

True if the TagToFind was found

Return type:

bool

has_valid_cached_input_cmd() bool

Has Valid Cached Input Cmd deprecated: HasValidCachedInputCmd has been deprecated, and is not needed since we no longer wait until movement simulation begins before providing a valid input cmd.

Return type:

bool

has_valid_cached_state() bool

Has Valid Cached State deprecated: HasValidCachedState has been deprecated, and is not needed since we no longer wait until movement simulation begins before providing a valid sync state.

Return type:

bool

property input_producer: Object
[Read-Write] Optional object for producing input cmds. Typically set at BeginPlay time. If not specified, defaulted input will be used.

Note that any other actor component implementing MoverInputProducerInterface on this component’s owner will also be able to produce input commands if bGatherInputFromAllInputProducerComponents is true.

see: bGatherInputFromAllInputProducerComponents

Type:

(Object)

is_modifier_active_or_queued(modifier_handle) bool

Checks if the modifier handle passed in is active or queued on this mover component

Parameters:

modifier_handle (MovementModifierHandle)

Return type:

bool

is_using_deferred_group_movement() bool

Returns true if this component is actually using grouped movement updates, which checks the flag and any global settings

Return type:

bool

k2_register_move(move_class) None

Registers layered move logic

Parameters:

move_class (type(Class))

k2_register_moves(move_classes) None

Registers an array of layered move logic classes

Parameters:

move_classes (Array[type(Class)])

k2_unregister_move(move_class) None

Unregisters layered move logic

Parameters:

move_class (type(Class))

property movement_mixer: MovementMixer

[Read-Write] Optional object for mixing proposed moves.Typically set at BeginPlay time. If not specified, UDefaultMovementMixer will be used.

Type:

(MovementMixer)

property movement_modes: None

[Read-Only]

Type:

(Map[Name, BaseMovementMode])

property on_movement_mode_changed: Mover_OnMovementModeChanged

[Read-Write] Broadcast when a MovementMode has changed. Happens during a simulation tick if the mode changed that tick or when SetModeImmediately is used to change modes.

Type:

(Mover_OnMovementModeChanged)

property on_movement_transition_triggered: Mover_OnTransitionTriggered

[Read-Write] Broadcast when a Transition has been triggered.

Type:

(Mover_OnTransitionTriggered)

property on_post_finalize: Mover_OnPostFinalize

[Read-Write] Broadcast after each finalized simulation frame, after the state is finalized. (Game thread only)

Type:

(Mover_OnPostFinalize)

property on_post_simulation_rollback: Mover_OnPostSimRollback

[Read-Write] Broadcast when a rollback has occurred, just before the next simulation tick occurs

Type:

(Mover_OnPostSimRollback)

property on_post_simulation_tick: Mover_OnPostSimTick

[Read-Write] Broadcast after each simulation tick and the state is finalized

Type:

(Mover_OnPostSimTick)

property on_pre_movement: Mover_OnPreMovement

[Read-Write] Broadcast during the simulation tick after inputs have been processed, but before the actual move is performed. Note - When async simulating, the delegate would be called on the async thread, and might be broadcast multiple times.

Type:

(Mover_OnPreMovement)

property on_pre_simulation_tick: Mover_OnPreSimTick

[Read-Write] Broadcast before each simulation tick. Note - Guaranteed to run on the game thread (even in async simulation).

Type:

(Mover_OnPreSimTick)

property on_teleport_failed: Mover_OnTeleportFailed

[Read-Write] Broadcast when a teleport has failed

Type:

(Mover_OnTeleportFailed)

property on_teleport_succeeded: Mover_OnTeleportSucceeded

[Read-Write] Broadcast when a teleport has succeeded

Type:

(Mover_OnTeleportSucceeded)

property persistent_sync_state_data_types: None

[Read-Write] List of types that should always be present in this actor’s sync state

Type:

(Array[MoverDataPersistence])

queue_layered_move_activation(move_logic_class) bool

Queues a layered move for activation. Takes NO Activation Context meaning the layered move will be activated using default Move Data. Note: Changing Move Data is still possible in the layered move logic itself See QueueLayeredMoveActivationWithContext for activating a layered move with context

Parameters:

move_logic_class (type(Class))

Return type:

bool

queue_next_mode(desired_mode_name, should_reenter=False) None

Queue a movement mode change to occur during the next simulation frame. If bShouldReenter is true, then a mode change will occur even if already in that mode.

Parameters:
  • desired_mode_name (Name)

  • should_reenter (bool)

remove_gameplay_tag(tag_to_remove) None

Removes a gameplay tag from this Mover Component

Parameters:

tag_to_remove (GameplayTag) – Tag to remove from the Mover Component

remove_gameplay_tags(tags_to_remove) None

Removes gameplay tags from this Mover Component

Parameters:

tags_to_remove (GameplayTagContainer) – Tags to remove from the Mover Component

remove_movement_mode(mode_name) bool

Removes a movement mode from available movement modes. Returns number of modes removed from the available movement modes.

Parameters:

mode_name (Name)

Return type:

bool

set_base_visual_component_transform(component_transform) None

Sets BaseVisualComponentTransform used for cases where we want to move the visual component away from the root component. See BaseVisualComponentTransform:

Parameters:

component_transform (Transform)

set_gravity_override(override_gravity, gravity_acceleration=[0.000000, 0.000000, 0.000000]) None

Set gravity override, as a directional acceleration in worldspace. Gravity on Earth would be {x=0,y=0,z=-980}

Parameters:
  • override_gravity (bool)

  • gravity_acceleration (Vector)

set_planar_constraint(constraint) None

Sets planar constraint that can limit movement direction

Parameters:

constraint (PlanarConstraint)

set_primary_visual_component(scene_component) None

Sets this Mover actor’s primary visual component. Must be a descendant of the updated component that acts as our movement root.

Parameters:

scene_component (SceneComponent)

set_up_direction_override(override_up_direction, up_direction=[0.000000, 0.000000, 1.000000]) None

Set UpDirection override. This is a fixed direction that overrides the gravity-derived up direction.

Parameters:
  • override_up_direction (bool)

  • up_direction (Vector)

set_updated_component(new_updated_component) None

Sets which component we’re using as the root of our movement

Parameters:

new_updated_component (SceneComponent)

set_use_deferred_group_movement(enable) None

Sets whether this mover component can use grouped movement updates, which improve performance but can cause attachments to update later than expected

Parameters:

enable (bool)

property smoothing_mode: MoverSmoothingMode

[Read-Write] If enabled, the movement of the primary visual component will be smoothed via an offset from the root moving component. This is useful in fixed-tick simulations with variable rendering rates.

Type:

(MoverSmoothingMode)

property starting_movement_mode: Name

[Read-Only] Name of the first mode to start in when simulation begins. Must have a mapping in MovementModes. Only used during initialization.

Type:

(Name)

property sync_inputs_for_sim_proxy: bool

[Read-Write] If enabled, we’ll send inputs along with to sim proxy via the sync state, and they’ll be available via GetLastInputCmd. This may be useful for cases where input is used to hint at object state, such as an anim graph. This option is intended to be temporary until all networking backends allow this.

Type:

(bool)

property transitions: None

[Read-Write] Transition checks that are always evaluated regardless of mode. Evaluated in order, stopping at the first successful transition check. Mode-owned transitions take precedence. */

Type:

(Array[BaseMovementModeTransition])

try_get_floor_check_hit_result() HitResult or None

Access the most recent floor check hit result.

Returns:

out_hit_result (HitResult):

Return type:

HitResult or None

unbind_process_generated_movement() None

Clears current bound event for processing movement after it has been generated.

property warn_on_external_movement: bool

[Read-Write] Whether to warn when we detect that an external system has moved our object, outside of movement simulation control

Type:

(bool)

property world_to_gravity_transform: Quat

[Read-Only] A cached quaternion representing the rotation from world space to gravity relative space defined by GravityAccelOverride.

Type:

(Quat)