unreal.MovementUtils

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

Bases: BlueprintFunctionLibrary

MovementUtils: a collection of stateless static BP-accessible functions for a variety of movement-related operations

C++ Source:

  • Plugin: Mover

  • Module: Mover

  • File: MovementUtils.h

classmethod can_escape_gravity(prior_velocity, new_velocity, gravity_accel, delta_seconds) bool

Checks whether a given velocity is strong enough to lift off against gravity

Parameters:
Return type:

bool

classmethod compute_angular_velocity(from_, to, delta_seconds, turning_rate_limit=-1.000000) Rotator

Computes the angular velocity needed to change from one orientation to another within a time frame. Use the optional TurningRateLimit to clamp to a maximum step (negative=unlimited).

Parameters:
Return type:

Rotator

classmethod compute_combined_velocity(params) Vector

Returns new velocity based on previous state, movement intent, movement mode’s influence and movement settings

Parameters:

params (ComputeCombinedVelocityParams) –

Return type:

Vector

classmethod compute_direction_intent(move_input, move_input_type) Vector

Computes the directional movement intent based on input vector and associated type

Parameters:
Return type:

Vector

classmethod compute_slide_delta(delta, pct_of_delta_to_move, normal, hit) Vector

Returns an alternative move delta to slide along a surface, based on parameters describing a blocked attempted move

Parameters:
Return type:

Vector

classmethod compute_velocity(params) Vector

Returns new ground-based velocity (worldspace) based on previous state, movement intent (worldspace), and movement settings

Parameters:

params (ComputeVelocityParams) –

Return type:

Vector

classmethod compute_velocity_from_gravity(gravity_accel, delta_seconds) Vector

Returns velocity (units per second) contributed by gravitational acceleration over a given time

Parameters:
Return type:

Vector

classmethod compute_velocity_from_positions(from_pos, to_pos, delta_seconds) Vector

Computes velocity based on start and end positions over time

Parameters:
Return type:

Vector

classmethod constrain_to_plane(vector, movement_plane, maintain_magnitude=True) Vector

Ensures input Vector (typically a velocity, acceleration, or move delta) is limited to a movement plane.

Parameters:
  • vector (Vector) –

  • movement_plane (Plane) –

  • maintain_magnitude (bool) – if true, vector will be scaled after projection in an attempt to keep magnitude the same

Return type:

Vector

classmethod is_exceeding_max_speed(velocity, max_speed) bool

Checks whether a given velocity is exceeding a maximum speed, with some leeway to account for numeric imprecision

Parameters:
Return type:

bool

classmethod try_move_to_slide_along_surface(updated_component, updated_primitive, mover_component, delta, pct_of_delta_to_move, rotation, normal, handle_impact) -> (float, hit=HitResult, move_record=MovementRecord)

Attempts to move a component along a surface. Returns the percent of time applied, with 0.0 meaning no movement occurred.

Parameters:
Returns:

hit (HitResult):

move_record (MovementRecord):

Return type:

tuple

classmethod try_safe_move_updated_component(updated_component, updated_primitive, delta, new_rotation, sweep, teleport) (out_hit=HitResult, move_record=MovementRecord) or None

Attempts to move a component and resolve any penetration issues with the proposed move Delta

Parameters:
Returns:

out_hit (HitResult):

move_record (MovementRecord):

Return type:

tuple or None