Hello,
we are currently experimenting with Mover and have run into what we think is a bug in the NavMoverComponent. Our player pawn is set up to move either with direct input from the player but can sometimes also move via nav movement. To handle this we first ask the NavMoverComponent if there is any input and if there is not, we use the players input, which looks something like this:
FVector MovementDirectionalInput, MovementVelocityInput;
if (NavMoverComponent->ConsumeNavMovementData(MovementDirectionalInput, MovementVelocityInput))
{
return MovementVelocityInput.IsNearlyZero() ? MovementDirectionalInput : MovementVelocityInput.GetSafeNormal();
}
const FRotator& ControlRotation = GetControlRotation();
const FVector FinalDirectionIntent = ControlRotation.RotateVector(MoverInputState.MovementInput.GetClampedToMaxSize(1.0f)).GetSafeNormal();
return FinalDirectionIntent;
This does work, as long as ConsumeNavMovementData is only called once per frame. If there is no nav input the function starts returning true when it is called more than once per frame, even though it should still be returning false for this frame. Looking at the function we are not quite sure what the idea was. It seems that checking if there was a new request needs to be cached whenever bHasFrameAdvanced is true and when it’s false it should be used instead of checking the frame counters.
For now we just worked around it by ignoring the input if both Direction and Velocity are zero, but it would be great to know if we are just not understanding the idea right now.
Thanks!
[Attachment Removed]