Can a physics handle be replicated?

Is there any way to make a physics handle replicate? I’m making an ability in my multiplayer project which spawns a riot shield, and the player holds it in front of themselves so it kind of floats with them. I’m going this route because I want to avoid players walking through the shield, so it has thickness and physically blocks everything. This works 100% perfectly on the host but if a client uses the ability, the host sees it correctly but the client can’t see that he picked up the shield, it flops on the ground. I can’t use attach actor because otherwise the shield won’t have physics. My setup is very close to the physics content example. I’m using a StaticMeshActor if it matters.

Here’s my blueprint of the player controller where the ability is toggled

Here’s my blueprint for the character which updates the position of the shield.

So my question is: How can I have a player hold a physics item in front of them and have other players see that replicated? Any ideas?

Same issue here, grabbed object will not be replicated. Maybe someone can tell us how that would work ? :slight_smile:

This is actually a bug in 4.4 (which is fixed in 4.5)

In the 4.5 release you should be able to mark the static mesh actor for replication using Static Mesh Replication.

Let me know if you run into more issues.

You have no idea how happy that makes me, I thought I was just a lousy programmer!

does the character have to be a certain object? We’ve imported our new character into the game but unfortunately I can’t find this option.

Make a multicast function with the needed code. Then, call the multicast function from a not replicated function. Finally, call the not replicated function from a Server RPC function (Run on Server).

The replicated functions have to be reliable. After making all those functions, make another one that is the final function that you will call from the input, check for authority (Switch has Authority), and for authority add the not replicated function, for the Remote add the Run on Server function.
These functions are actually custom events in Blueprints.

Example C++ Code:

void MulticastGrab()
{
     // Do code here.
}

void NotReplicatedGrab()
{
     MulticastGrab();
}

void ServerGrab()
{
     NotReplicatedGrab();
}

void Grab()
{
     if (HasAuthority())
     {
          NotReplicatedGrab();
     }
     else
     {
          ServerGrab();
     }
}