x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

alt text

Product Version: Not Selected
Tags:
more ▼

asked Feb 15 '15 at 11:42 PM in C++ Programming

avatar image

envenger
418 76 117 145

avatar image envenger Feb 16 '15 at 07:17 PM

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.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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!

more ▼

answered Apr 08 '16 at 05:55 AM

avatar image

Naerbnic
1 1

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question