0
\$\begingroup\$

I am working on a melee in Unreal Engine 4 that lunges towards an enemy until it reaches it and applies damage.

I have tried various approaches to get the movement looking smooth on the local client.

  • I have tried storing past character locations on the server and lunging towards a location in the past on the server. In order to try to get the server and client lunging towards the same location. This works in the case where there is no collision blocking that location on the server. But fails when there is collision between those points. For example, when the enemy is walking towards the attacker. The rewind location is therefore behind the real location of the enemy on the server. So collision with the victim character blocks the attacker from reaching the rewind location on the server. Thus causing correction on the client. I can't just disable collision in this case because we support listen servers as well. If I did this the listen server would see players lunging through each other.

  • I have tried using bIgnoreClientMovementErrorChecksAndCorrection=true to do a client authoritative approach where the client drives the movement and the server just follows. This works except when I flip the bool back to false, at the end of the melee, I still get a very noticeable correction.

This is all using CharacterMovementComponent. The goal is to have butter smooth movement on the local client without any noticeable corrections.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.