ReplicateMovement not working on the owner client
I got a problem. I have a class derived pawn as my character.
I have switched on the replication for it.
But the problem is it replicates for all other clients except itself. I am passing the input to the server and making movement changes on it.
I just need the movement to updated on the clients. The movement is getting updated to all other clients except the owner.
Its same for all clients. I can see all other pawns moving on my screen except its own pawn. It doesn't move
asked Feb 15 '15 at 11:42 PM in C++ Programming
I've run into the same problem, and I think I've discovered the solution.
bReplicatesMovement only replicates movement when the object is a physics object, or the remote role is simulated. This seems to be the case because the MovementComponent for your pawn (most typically the UCharacterMovementComponent) normally has special handling for the AutonomousProxy's motion to avoid apparent stuttering for the client.
The line that is causing this is here: https://github.com/EpicGames/UnrealEngine/blob/dff3c48be101bb9f84633a733ef79c91c38d9542/Engine/Source/Runtime/Engine/Private/ActorReplication.cpp#L305
I haven't been able to find documentation elsewhere, but from what little I've gleaned from CharacterMovementComponent, the correct thing to do is to use your own replication or RPCs to update the client. In addition, you can add an INetworkPredictionInterface implementation to make movement smoother on non-owning clients, and to help implement the client data structures for your autonomous proxy.
answered Apr 08 '16 at 05:55 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here