ReplicateMovement not working on the owner client

Hello…

I got a problem. I have a class derived pawn as my character.

I have switched on the replication for it.

	bReplicateMovement = true;
	bReplicates = true;

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

http://s3.postimg.org/7l6o20fpe/Capture.jpg

No 1 knows why is it happening? Or is it completely normal?

I have finished writing a new set of codes for replication cause this didn’t work. But I want to know why?

My past 5-6 answerhub questions are still unanswered.

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.

Good luck!

1 Like