Navigation
API > API/Plugins > API/Plugins/MassCharacterTrajectory
Enables 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.
| Name | UCharacterTrajectoryTrait |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MassGameplay/Source/MassCharacterTrajectory/Public/MassCharacterTrajectoryTrait.h |
| Include Path | #include "MassCharacterTrajectoryTrait.h" |
Syntax
UCLASS (MinimalAPI, EditInlineNew, CollapseCategories,
Meta=(DisplayName="Character Trajectory Generation"))
class UCharacterTrajectoryTrait : public UMassEntityTraitBase
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UMassEntityTraitBase → UCharacterTrajectoryTrait