Character with CharacterMovementComponent will replicate movement with Replicate Movement off

Bug Description:

On a character with a CharacterMovementComponent, Replicate on, Replicate Movement off, client cannot move character that is possessed by their Player Controller as Server corrects any movement updates, although Replicate Movement is off. desired behavior is that client and server can move around freely without their movement replicating.

With same logic on a Pawn client and server can move around freely as is desired behavior.

Verification:

Using p.NetCorrectionLifetime 5 on client shows that server is correcting position of client’s character.

Replication:

  1. Create a new project
  2. Create a character, Replicate On, Replicate Movement Off.
  3. Add simple movement input via blueprint or c++
  4. Use p.NetCorrectionLifetime 5 in console and attempt to move character on client, notice that character will not move and debug from p.NetCorrectionLifetime will show Server snapping character back to position.
  5. Copy movement input logic into a pawn and move pawn on client. Notice it will not be restricted as is desired behavior.

More information regarding this problem: [4.7] How Can I Fully Disable Character Movement Replication? - Character & Animation - Epic Developer Community Forums

Hi jaught,

I wasn’t able to reproduce any unusual behavior with a Character not being able to move on Client when ReplicateMovement is disabled. To test, I created a new character, turned off ReplicateMovement, and gave it same basic forward/right movement as a new ThirdPerson template project (AddMovementInput). On Client, character moves as expected and that movement is not replicated to other Clients (though it does appear on Server, as you’d expect).

Is there anything else I need to do to reproduce this? Using p.NetCorrectionLifetime 5 had no impact. If you can put together a small test project and upload it somewhere for me, I can see what you might have done differently. Thanks!

Hey !

Its entirely possible that I am overlooking something however I have created a test project with issue present.

https://.com/file/d/0B0GBVrfS-nlbcjZOQ3ZOeWR3QU0/view?usp=sharing

If this isn’t desired behavior I noticed in UCharacterMovementComponent::ReplicateMoveToServer there is no check to see whether bReplicateMovement is flagged and a check like:
if (!CharacterOwner->bReplicateMovement)
{
return;
}

may solve my problems. I haven’t had a chance to test it however.

Hi jaught,

Thanks for test project! I saw same behavior you described in your project, and determined cause is Add Actor Local Offset node. It appears to not be working correctly on Clients, and it has nothing to do with ReplicateMovement setting. You can get around this by using different movement methods, such as Add Movement Input (which is what I originally tested with, and can verify works on Clients).

I’ve entered a bug report for issue (UE-13071), and I’ll let you know as soon as I see an update on it. Thanks again!

Great news ! I’m glad that I could help.

I should also note that using following setup has same results: http://jamesknight.net/wp-content/uploads/2015/04/SetActorLocation.png

This is why I believed it was ReplicateMovement setting as any nodes that change positions without considering network don’t move client but any movement nodes that likely consider network do. That and p.NetCorrectionLifetime 5 would display corrections even when replicate movement was off.

I hope this information helps and I’d love to keep in loop of what issue is!

Thanks for additional information. I’ll add that to bug report. It makes sense to me that if Add Local Offset nodes aren’t working, that Set Actor Location nodes would have same problem. Add Movement Input uses CharacterMovement directly, I believe, so it functions differently.

That makes sense, thanks again !