Mover question. here is code copy from source. UE 5.7
Why Request cancelation of any matching ACTIVE movement features during the next simulation tick? anyone helps
void UMovementModeStateMachine::CancelFeaturesWithTag(FGameplayTag TagToCancel, bool bRequireExactMatch)
{
// Cancel all matching queued movement features
{
UE::TRWScopeLock QueueLock(ModifiersQueueLock, SLT_Write);
QueuedMovementModifiers.RemoveAll([TagToCancel, bRequireExactMatch] (const TSharedPtr<FMovementModifierBase>& Modifier)
{
return (Modifier.IsValid() && Modifier->HasGameplayTag(TagToCancel, bRequireExactMatch));
});
}
{
UE::TRWScopeLock QueueLock(LayeredMoveQueueLock, SLT_Write);
QueuedLayeredMoves.RemoveAll([TagToCancel, bRequireExactMatch](const TSharedPtr<FLayeredMoveBase>& LayeredMove)
{
return (LayeredMove.IsValid() && LayeredMove->HasGameplayTag(TagToCancel, bRequireExactMatch));
});
}
{
UE::TRWScopeLock QueueLock(LayeredMoveQueueLock, SLT_Write);
QueuedLayeredMoveInstances.RemoveAll([TagToCancel, bRequireExactMatch](const TSharedPtr<FLayeredMoveInstance>& LayeredMoveInstance)
{
return (LayeredMoveInstance.IsValid() && LayeredMoveInstance->HasGameplayTag(TagToCancel, bRequireExactMatch));
});
}
// TODO: also support cancellation of queued instant effects if they end up supporting gameplay tags
// Request cancelation of any matching ACTIVE movement features during the next simulation tick
{
UE::TRWScopeLock QueueLock(ModifierCancelQueueLock, SLT_Write);
TagCancellationRequests.Add(TPair<FGameplayTag, bool>(TagToCancel, bRequireExactMatch));
}
}