Hi! My project in UE4 has an issue that I’m not completely sure how to fix. I’m not good with replicated events and that stuff. I’ve run into a big problem, where when the player touches a collision box, it fires an event to every player and the server. I set the event to client only, and when I print who touched it, it says every player in game touched it and the server. Why is this?
What am I doing wrong?
Hi, get the player controller with index 0 and get the controller from the “BuildingCharacter” that overlapped the box and only continue if both are the same.
Basically if the collision box exists on all clients and since each player pawn exist on all clients the overlap event will then be called on all clients since it is overlapping on all clients. Since you only want to execute this logic only on the client whose pawn has overlapped you can get the player controller with index 0 (this will always return the local player controller) and check if it is the same controller as the one that is controlling the pawn.