unreal.CharacterTrajectoryTrait¶
- class unreal.CharacterTrajectoryTrait(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
MassEntityTraitBaseEnables trajectory generation for this entity. Adds FCharacterTrajectoryFragment and configures trajectory sampling parameters (history size, prediction samples, sampling interval).
- The trajectory is generated each frame by one of two processors depending on configuration:
USpringMovementToCharacterTrajectoryProcessor: if USpringMovementTrait is also present, uses the spring runtime state to predict a smoothed trajectory.
UMovementToCharacterTrajectoryProcessor: if no spring is present, uses current velocity and desired movement with constant-velocity extrapolation.
- This trait can be combined with:
USpringMovementTrait: spring-damped movement with trajectory prediction for animation.
UCharacterTrajectoryMovementTrait: overrides default movement to drive the entity along the generated trajectory instead.
Both: spring update feeds trajectory generation, trajectory drives movement.
Also initializes MeshRelativeTransform from the entity’s SkeletalMeshComponent if present.
C++ Source:
Plugin: MassGameplay
Module: MassCharacterTrajectory
File: MassCharacterTrajectoryTrait.h
Editor Properties: (see get_editor_property/set_editor_property)
pose_trajectory_parameters(CharacterTrajectoryParameters): [Read-Write]valid_target_config(ProcessorExecutionFlags): [Read-Write] Configures which configurations are targeted by this trait. Use it to have different configurations for client and server, for example.