Hey everyone,
I am pretty new to the editor but have been having a lot of fun, but I ran into a problem when I tried to use the Physics content example to move things around a scene in game. I can move things but they are not replicating to the others, be it a server or client. I would like to be able to move stuff around in my scene from a client and have it replicate on other clients while running everything on a dedicated server, is this possible and if so your help would be greatly appreciated!
I would like this answer as well
So I started on this project again and I now have a different problem, the server can see both the client and its own moving of the physics object. The client however cannot see anything be it the server or the client itself moving the object.
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();
}
}