How Can I Replicate an overlap?

https://forums.unrealengine.com/ewewfewfewfwefew
Hi, I was recently trying to make an ovrelap of a collision box replicable, I have been stuck in this obstacle for a long time, could you help me? Thanks

Hi, in most cases there is no need to replicate it. If the overlapping actor and the box collision both exist on the server and move the same on the serve as on the clients, then the overlap will also happen on the server and therefore there is no need for the client to tell the server. That is generally the way I would build the logic.

If for some reason the overlapping actor or the box collision is not existing on the server or not behaving the same on the server and for some reason you still want the server to know that an overlap has happened on some client, then you need a way for the client to tell the server that an overlap has happened and you do that via a RunOnServer event. But the only client that can call a RunOnServer event on an actor is the client that owns that actor. If any other client tries to call a RunOnServer event nothing will happen. Therefore you could reroute the event through something that the client does own (clients player controller or controlled pawn) or tell the server to set this client as owner of the actor (again telling the server from the player controller or the controlled pawn). But imho both ways are not optimal and therefore you try to build your logic in a way that the overlap automatically happens on the server and therefore removing the need for the client to tell it.

While they both exist in client and server, they not share the same location, well at least in UDK idk about UE4…

You may not need to replicate it, but if you want a multicast from server would be enough -> AddCustomEvent -> Choose run from server -> From this new event AddCustomEvent -> Choose Multicast then the clients they all will receive that event and do stuff with servers precision.

In the end I fixed this error, what I did was create another blueprint class (with the collision box inside of course) I set the overlap and I noticed that strangely one was replicable so I made the classic replicable spawn class ( two custon events one run on server and the other multicast) and it worked thank you

can you send a picture with a better explanation? Been tripping on this forever, cant get enemies to die from instakill on an overlap event on server, only on the client that has instakill active

A video of the layout would help but easy would be from client communicate to the server that we have hit a collision device…
Then from the server handle results…

Keep asking i can keep helping you until we get it.

1 Like

On Begin Overlap (whatever component): → switch has Auth (Auth)…

This ensures that the overlap logic will only apply on the server (Authoritative Proxy). Nothing happens on the client.

From there you can call a multicast… seeing as the logic is already “only” running on the server.

1 Like

Finally figured this out, seems ridiculous. If anyone has a better way or maybe even a good explanation of why this works now let me know! (and yes I tried to just set the first custom event cast to actor’s health to zero in the first place, but ended up having to jump through like 3 hoops and use damage instead)