Client loses VR motion controller when connected to dedicated server

I can’t figure this out and none of the existing threads about VR motion controller problems in multiplayer quite describe what I’m seeing.

When I run a packaged build in single player, the motion controller works 100% correctly, I can see the motion controller model on the client, debug output is outputting it’s coordinates correctly and it’s correctly driving an animation blueprint I’ve got set up.

If I run a dedicated server and connect the client to the server (one server, one client. Have tried with the client running on the same machine as the dedicated server and on a different machine), the motion controller is gone. Debug output isn’t updating transforms based on the movement of the controller, the client can’t see their own controller, and the anim blueprint is being driven as if the controller is locked at World 0,0,0…

This doesn’t seem to be a replication issue, as I’m driving the head motion of the animation BP based on the camera/headset in the same function as motion controller transform, and the head works fine.

My setup is that I’ve got a Pawn that is more or less the same as the VR example pawn. Main differences are that there are a couple of custom C++ components being used for gesture recognition, and I’ve directly added the motion controller instead of spawning motion controllers via blueprint. The motion controller is itself a blueprint that just has a motion controller component as its root and another custom C++ component.

On Tick I call a CLIENT_Update_Hand event that updates a Hand Transform variable (that is set to RepNotify) with the world transform of the motion controller, I then do a HasAuthority switch that calls a SERVER_UpdateTransforms event that updates the Hand Transform as well as a Head Transform variable (for controlling the Anim_BP head) when Remote.

All of this works fine in-editor, but in the packaged build, when connected to the server, only the head updates. [edit]Actually, looks like it doesn’t really work in-editor when running with Dedicated Server checked. The anim blueprint fights between a world location that the server is giving it and the 0,0,0 that the client is getting, and the motion controller itself is still not visible or doing anything it should be.

If this were only a replication problem I wouldn’t be too fussed, but since the client can’t see their own motion controllers there’s a bunch of gameplay that won’t work because the gesture recognition is dependent on the motion controller transforms updating correctly.

Has anybody seen this, or have any ideas on how to fix it?

I figured it out. Somewhat counterintuitively (and as far as I can tell not mentioned anywhere), you have to set the motion controller component/blueprint to not replicate when connecting to a server. I guess if it replicates, the server’s motion controller (which doesn’t exist when using a dedicated server) overrides all the clients’.

Hey DLejeune I’m having the same problem right now. How do you tell it not to replicate when you connect to the server?

There isn’t a ‘don’t replicate when connecting to server’ setting. Just set the motion controller component to not replicate.

If you need some motion controller data to replicate (i.e. transforms for driving a multiplayer avatar) you’ll have to create some replicated variables and use an RPC to set them on the server and manually update a mesh or animation blueprint with those variables.