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
- 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).
- 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:
- classmethod compute_direction_intent(move_input, move_input_type) Vector ¶
Computes the directional movement intent based on input vector and associated type
- Parameters:
move_input (Vector) –
move_input_type (MoveInputType) –
- Return type:
- 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
- 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:
- classmethod compute_velocity_from_gravity(gravity_accel, delta_seconds) Vector ¶
Returns velocity (units per second) contributed by gravitational acceleration over a given time
- classmethod compute_velocity_from_positions(from_pos, to_pos, delta_seconds) Vector ¶
Computes velocity based on start and end positions over time
- 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.
- 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
- 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:
updated_component (SceneComponent) –
updated_primitive (PrimitiveComponent) –
mover_component (MoverComponent) –
delta (Vector) –
pct_of_delta_to_move (float) –
rotation (Quat) –
normal (Vector) –
handle_impact (bool) –
- 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:
updated_component (SceneComponent) –
updated_primitive (PrimitiveComponent) –
delta (Vector) –
new_rotation (Quat) –
sweep (bool) –
teleport (TeleportType) –
- Returns:
out_hit (HitResult):
move_record (MovementRecord):
- Return type:
tuple or None