Movers MoveDirectionIntent can be 0 when switching to the opposite direction in Fixed Interpolation mode

Hello.

While working with Mover, I noticed some of my animations would sometimes stop and start again when changing directions rather than pivoting. This is due to the MoveDirectionIntent being 0 due to the interpolation result of two frames that are exactly opposite. It seems like a bit of a unique situation so I fixed it locally with the following but I’d love to know how you’d fix it.

At the end of FMoverDefaultSyncState::Interpolate:

// In rare cases, the FromState and ToState can be exact opposites and when lerping between the two the MoveDirectionIntent will be zero. This check is to avoid that case if (MoveDirectionIntent.IsNearlyZero() && !ToState->MoveDirectionIntent.IsNearlyZero()) { MoveDirectionIntent = ToState->MoveDirectionIntent; }

Steps to Reproduce

  1. Create a mover character.
  2. In OnProduceInput, move the character right continuously and then swap directions every 0.5 seconds
  3. Set the network prediction mode to Fixed Interpolated
  4. Output the FMoverDefaultSyncState::MoveDirectionIntent every frame. Occasionally you will see an intent of 0 when switching directions

Hi,

Thank you for bringing this to our attention!

If you’re not seeing any issues with your workaround, then it does seem reasonable. I can’t speak to exactly how we may address this problem, but for tracking our own fix for this, I have opened a new issue, UE-273828, which should be visible in the public tracker in a day or so.

Thanks,

Alex