In MassEntity-based crowds, when an agent transitions from Stand to Move and begins walking, the Avoidance trait parameters StartOfPathDuration and StartOfPathAvoidanceScale, which are meant to temporarily soften avoidance at the start of a path, have no effect. When agents start walking out of a dense cluster, full avoidance force is applied immediately, producing oscillation (agents jittering side to side) and momentary backward movement.
FMassMoveTargetFragment::CreateNewAction only updates CurrentAction and never writes PreviousAction. PreviousAction is declared in the header with an initializer of EMassMovementAction::Move, and a tree-wide search finds no assignment to it anywhere outside that initializer. It is not updated in CreateReplicatedAction either.
As a result, GetPreviousAction() always returns EMassMovementAction::Move.
The following branch in UMassMovingAvoidanceProcessor::Execute (MassAvoidanceProcessors.cpp) is therefore always false, leaving NearStartFade at its initial value of 1.0:
if (MoveTarget.GetPreviousAction() != EMassMovementAction::Move)
{
NearStartFade = FMath::Min((CurrentTime - MoveTarget.GetCurrentActionStartTime()) / MovingAvoidanceParams.StartOfPathDuration, 1.);
}
The subsequent line:
const FVector::FReal NearStartScaling = FMath::Lerp<FVector::FReal>(MovingAvoidanceParams.StartOfPathAvoidanceScale, 1., NearStartFade);
then always evaluates to 1.0 (no scaling), so StartOfPathAvoidanceScale and StartOfPathDuration are effectively ignored.
Add PreviousAction = CurrentAction; in CreateNewAction before CurrentAction is overwritten:
void FMassMoveTargetFragment::CreateNewAction(const EMassMovementAction InAction, const UWorld& InWorld)
{
ensureMsgf(InWorld.GetNetMode() != NM_Client, TEXT("..."));
PreviousAction = CurrentAction; // added
CurrentAction = InAction;
CurrentActionID++;
// ...
}
Expected Result
Immediately after movement starts, avoidance force is reduced by StartOfPathAvoidanceScale and fades in to full avoidance over StartOfPathDuration. Walking out of a dense cluster is smooth.
Actual Result
Full avoidance force is applied the instant movement starts. Agents that were packed closely together are shoved apart abruptly by strong separation forces, producing oscillation (jittering side to side) and momentary reversal / backward movement. Changing StartOfPathAvoidanceScale / StartOfPathDuration to any value has no effect on the behavior.
However, even if you follow these steps, it can be difficult to confirm the issue if the agents do not start moving in a situation where they are overcrowded.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-388548 in the post.
| 0 |
| Component | UE - Runtime - Character |
|---|---|
| Affects Versions | 5.7, 5.8 |
| Created | Jul 28, 2026 |
|---|---|
| Updated | Jul 28, 2026 |