Physics Handle Replication

Hello! I’ve run into a bit of a problem.

I’ve started to study replication for networking and online games. It’s pretty complicated but I finally got a hold of the idea and implemented it into all of my player’s functions. However, there is one thing that I just can’t figure out.

I have a function that allows the player to pickup objects when E is pressed, shooting a LineTraceByChannel from the World Location of the player’s camera forward. Once it makes contact with an object that has physics enabled, it sets the objects location to a SceneComponent being used as a location for a Physics Handle in front of the player.

This all works, and is multicasted to replicate for Server and Client to see, but the problem is that when a player picks an object up, they can move the object around on their screen with the mouse, but the other player cannot see that movement. The only movement of the held object they see is when the player actually moves. My guess is that the opposite player is only seeing the object from where the Physics Handle is originally set, which shouldn’t be happening because I’m using GetWorldLocation.

I’ve also tried making the SceneComponent a child of the player’s Camera or CameraBoom, but with no success. And if pictures are required to understand I can do that. Any help would be greatly appreciated! :slight_smile:

I think that the problem might be the multicast. Multicast are supposed to be used mostly for aesthetic purposes, like playing sounds or spawning particles. So there might be a problem on how you are trying to replicate the behaviour.

If you could show some screenshots of your code it would help me narrow down the problem.

Sorry if this is too much. Do you need an example of the problem happening in game?

Hey!! Could you do this? I have been trying to handle physics replication and just have nothing working…

Haven’t even tried it since I’ve had the problem due to other projects. I might as well give it a go right now and see if I can make anything work. I might even try it in C++ also.

Aha! I have found something. I set both the Grab Object and Drop Object functions to Run on Server instead of Multicast, and then added a Set Owner node after the Grab Component node. This allows the Server to be able to see the Client pick up and move the object with the mouse. The only problem is that the Client himself can not see this happen and the same thing does not happen when the Server picks up the object.

Well, I can do the same, if I pick up an object from server everything works fine, but not matter what option I set (Run on server, multicast, etc) I just achieve pick up objects from server :C it starts making me crazy!! :open_mouth: