Issues getting parts of an Actor to communicate with Clients and Server

Going to be a bit of a long one, but I’ll do my best to explain. I got an asset from the UE store a while back and decided to try and implement it in to a multiplayer game my friends and I are working on. The assets are a set of mini-games. The games work just fine in single player, but in MP, I’m running into some issues.

There is a parent class and some children (the children being the games themselves), and the parent holding some of the setup functions. I added in an event interface to interact with the mini-games, as well as exit out of them (E to enter/interact, F to cancel)

In the minigame itself, the Event Force Action is both what triggers the game and controls it (in this case, its a box that moves across a horizontal bar and you have to press the button at the right time).

At some point along this event is a branch; this branch is triggered if you either press the box in the correct spot or press it in the wrong spot. If the box is pressed correctly, it seems to only be communicating with the client, but if you fail, its speaking to the client and the server (which I want)


The goal is to finish the game, fire off an event dispatcher to later on down the line trigger some other things in the level. When the game completes, its only speaking to the client. I’ve also confirmed that simply entering the mini game and pressing the event button triggers on both the client and the server. Also, if you press the F button to exit out early, its triggering server and client side. Should also mention that the blueprint is set to replicated, and that the movement of the box in the minigame itself doesn’t match between the client and the server (I don’t care to have that be the case, just need the success to trigger the way I need it to).

I’ve tried creating RPCS for nearly everything, I’ve tried setting most of the variables to replicate but either it doesn’t do anything, or doesn’t allow to client to interact at all (I should note, that if the server is trying the game (by way of listen server) everything works as expected). Any help that could steer me in the right direction (or flat out help me solve this) would be greatly appreciated.

What class is calling Event Interact ?
What class is implementing Event Interact ?

Get Player Character (index) is a SinglePlayer / Coop node.

Event Interact is implemented in the Parent Mini-Game Class and the BP Character is calling it to interact with objects. What do you recommend to use instead of Get Player Character?

I’d recommend calling the parent mini game from the controller class.

Client controller RPC to Server
Server call Event Interact on the parent mini game.

Event Interact can pass a reference of the controller to the mini game… as of right now it is passing a reference of character actor obj ref.

There’s also the Multicast… Owning_GameStart . What’s the point of this?

Multicasts are executed by the server and ALL clients.

So as of right now, I have the interact functionality in my BP character class, you’re suggesting to put this inside of the Controller Class?

There’s also the Multicast… Owning_GameStart . What’s the point of this?

I was throwing stuff at the wall trying to get it to work.

That interaction setup isn’t correct.

When a client calls IA_Interact you are RPC’ing the server and having it tell every connected client and itself to interact.

So you tapping your interact key tells everybody and the server to get all of their overlapping actors and Loop them for implemented interface, then call interact on the first thing it can.

Now imagine you have interactable doors in your game and 3 of 16 players are near a door. When you interact you’re literally telling those other 3 doors to either open or close.


Interaction should work as follows.

IA_Interact → Client does a check for anything interactable. If Found, RPC server to attempt interaction.

Server attempts interaction. If found, call interface event.

Here’s a tutorial I wrote specifically for multiplayer. It uses a line trace from camera for accurate intentional interaction.

Thanks for the explanation. I’ll review the video, make changes on my end, and I’ll let you know.

1 Like

Check Part 2 for additional tweaks and information

So I watched all 4 of your videos, a lot of great insight and there are certainly things I will change in my code in the future. However, prior to making changes, things like my doors, my weapon pickups, and my light switches all worked in multiplayer just fine. I’m sure my interaction system isn’t implemented all that great, but it did work (even in a full dev build). After switching over to how you recommended doing it in the video, all my other interactables no longer work, and the minigames went from almost working to not working at all either.

I actually just got it working. The randomization of the mini-game setup wasn’t being replicated. I simply set that variable to replicate and set the randomization in the construction script, now its working like a charm. I will be looking at my implementation system and look at setting it up similarly to what you suggested. Thanks for your help!

For multiplayer you want to treat anything that has an impact on the game world and game play, including inventory likes it real world money in a bank.

Doors, loot items, health, score, inventory, mini games etc.

You can’t walk into bank vault and grab cash. You have to talk to the bank, it verifies you have the funds then hands them to you. The server is your bank.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.