Replicate movement without having "Replicate Movement" checked?

I know this may be an odd question as “Replicate Movement” already accomplishes replication, BUT I have been developing a VR character that was unable to rotate when “Replicate Movement” was enabled. By disabling, I am now able to properly replicate rotation over the network but now the client is unable to walk. So I thought “Okay I’ll just RPC the AddMovementInput node and that should work”. Well I was wrong, so now I’m here.

Here is a few different things I’ve tried and failed. What am I doing wrong?

Version 1:


001_2

Version 2:
002

Isn’t the right question “why can’t this client move when replication is on?”

Player controllers can have the authority for orientation, and even for position, even in a networked game. It sounds to me like your player replication / position inheritance is set wrong, and debugging and fixing that would be a better approach.

That being said: VR and multiplayer is generally pretty hard to merge. Space flight games can do it, because space ships aren’t up close and personal to each other. But characters? The first time something happens on the server that you didn’t predict: Barf City!

1 Like

You’re right but I didn’t get any helpful answers for 2 weeks when I posted about needing help with client rotation. So I was stuck, decided to turn off movement replication and now I have a new problem. lol

Version 2 looks to be right. Have you tried removing the branch and see if you are able to get your RPC to trigger? And maybe hook up some print strings throughout it to see what kind of values are coming out of it…?
I’ve had issues using values == 0 off a branch before as if the value was unreliable enough to get through the branch idk… I had to take a different approach.

I have a similar setup working though much like you have with the only exception is that I let my forward vector logic run straight off the “AddMovementInput” node without running it through the RPC. In other words maybe try from your camera component > get forward vector > make vector and run it straight into the “AddMovementInput” node’s world directions pin.

Mine looks almost exactly like your “Version 2” but in the screenshot below I just feed that straight into the “AddMovementInput” node. I use a slightly different logic for the camera rotation. I dont have any branches checking the axis value though, because like I said it wouldn’t ever get through the branches.

1 Like

Awesome. Thanks for replying and sharing.

I will try this over the next few days and report back. I had a feeling that maybe the branch was an issue but wasn’t sure since it works locally.

Update.

I tried your method and the character started rubberbanding/stretching/duplicating itself all over the map… Tested the RPC as reliable and unreliable. Guess I’m stuck again.

Idk if it matters but the Mesh, VRRoot, Camera, and Controllers are marked as “Component Replicates” as well.

It’s fighting your logic somewhere. I just also realized that I’m not sure if we covered this, but you need to be running all this same logic on a “RunOnClient” event the same way you have the server/multicast events as well. There is no client prediction and I’m not sure why I didn’t see that.

I went through getting all this stuff to replicate on a dedicated server and it took a tremendously long time since I figured it out on my own and there is practically no one covering this anywhere over dedicated servers (Months).

You have to set your max walk speeds with branch checks at the tail end of all this logic also because the server has no way to know how fast or slow you are wanting to move without making those checks over the RPC giving you even more rubber banding… Like when you are “Sprinting” and your speed needs to increase. Well, the server doesn’t know that you are sprinting and you have to replicate that boolean and set the speeds as well on the client and the server.

Here is a bit of what got my project in sync over the network (hopefully you can see it):

1 Like

It’s a bit hard to read certain nodes like the branches.

I see you have Get Control Rotation hooked up to the Z axis?

Also I’ve been looking into this a lot and found out that “Replicate Movement” only replicates rotation from server to client. Trying to RPC the rotation from client to server does not work if I use SetWorldRotation to the Mesh. Apparently AddMovementInput does get replicated automatically but I can’t use that node for HMD rotation.

Currently I’m trying a new solution that has “Replicate Movement” enabled but to also enable “Use Controller Desired Rotation” with “Use Controller Yaw” disabled. It’s untested at the moment as I have to wait for my friend to try it in VR over multiplayer.

I’ve literally packaged this 35 times now with a different solution for each one…