Run on server doesn't get triggered on Actor Blueprint

You can only send events to the server if you are the owning client. (Replicated to server (if owning client))
I think the default behavior is that the player controller and player character are the only objects that are owned by the player. This is the reason the doors does not respond.

A solution would be to move the open door request to the player controller.

Hey guys, I’m trying to implement the door opening/closing functionality in a multiplayer game. The door has its own blueprint and I’ve set it up as follows:

When I press the E key in the server window, the door opens/closes properly. But when I press the E key in the client window, the door doesn’t respond at all. Can someone please help me to fix this issue?

But, I have multiple interactable objects in my game. It would be very hard to implement everything in one BP. Surely, there must be other ways? Thanks for the quick response, btw!

I don’t know if there is an easy workaround for multiplayer games.
If all you want to do is “use items” you can abstract that behavior. Create an event dispatcher in your player controller and call that on pressing “E”. The server game mode binds to that event dispatcher and forwards the request.

Edit: I think the Post Login event is 4.7 only.
Quick test, I don’t know if this works but it may help understand my idea.

Player controller:

30236-playercontroller.png

Game mode

30237-servergamemode.png

Door

Thanks, i’ll give it a try! But, I really hope there is a straightforward method instead of going through all this hoopla

Hello,

I am not sure if this worked for you (it is a while ago), at least it did not work for me (not on the client side).
So I tried to figure out why it did not work for me (UE4 version: 4.9). This is my solution:

  1. Set blueprint to replicated(I am not sure if needed, but I thought it was needed for all networking related)

  2. Probably the most important one (though I am new to networking so I may be completely wrong):
    The playercontroller is getting called from the owning client, it then calls on his own side the dispatcher, the dispatcher is never called on the server! So I made it send first to the run on server through a “Custom Event” “set to Run on Server”. This made sure that the server receives the dispatcher event.

Everything next is still the same:
Now in the ServerGamemode:
The OnPostLogin event will make sure the dispatcher in the player controller is bind to an event. That event calls another dispatcher inside the GameMode.
Binding this Dispatcher in the door blueprint will actually execute it.

And the door blueprint (okay, fence but the idea is still the same)

I am not sure if this is the best way, because I am still new to networking.
At least this worked for me.

Greats,
Micheldb

post scriptum:

This is a my first post on the unreal community. So I would like to receive feedback, was this post too long? Should’t I answer on old questions? (off-topic so please send me a private message). Also sorry for grammar or spelling mistakes, English is not my native language.

[EDIT] You also probably want to check who is inside the triggervolume, otherwise when some one is in the volume everyone can trigger it… To do this:

Copy the reference of the playercontroller through the functions(all call on server and all multicast, dispatchers…) In the Blueprint make a list of actors in the volume (array Character).

Cast the “other actor” in begin overlap to Character and addUnique to the array.

Just before the “action” in the door blueprint, check if the character that is calling to open the door actually is in the volume( copied reference of the actor is in the array)

Also remove character from array if end overlap.

Thanks that helped a lot. but i have i problem with the collision (I think).
my character is jigglin when I walk threw the door (bouncing up and down).
The Server character doesnt do that, but i can see it at the client window.