Hi, a small suggestion to future releases:
I have seen that this method doesn’t always works to stop movement, specially after the character movement being fired by SimpleMoveTo().
It’s because it doesn’t stops the PathFollowComponent by simply zeroing velocity.
So, I would suggest a small addition:
inline void UMovementComponent::StopMovementImmediately()
{
Velocity = FVector::ZeroVector;
UpdateComponentVelocity();
// Suggestion
UPathFollowingComponent* PathSys = GetCharacterOwner()->Controller->FindComponentByClass<UPathFollowingComponent>();
if (PathSys)
{
PathSys->AbortMove(TEXT("Ordered by MoveComponent."));
PathSys->InitializeComponent(); // <- If Reset( ) wasn't protected I would preffer instead of need reinit the comp
}
}
Hope it helps.