RPC Custom event

I’ve got a custom event that’s set to run on server.

The custom event is in, and called from the level blueprint.

It works fine when the listen server/user calls it.

When a client calls the event, nothing happens, and the client continues down the exec chain.

It seems it’s simply not running on the server.

Now, about what the custom event does. The custom event translates a movable staticmesh actor. This actor replicates.

For some reason whenever the clients call the server to translate the actor for them, it does nothing.

So what am I doing wrong?

obligatory prtscn

I’ve also tried looking up how to set and get the netOwner from my beaker, but to no avail. Does not seem reachable in blueprints

It seems as though you can’t call Run on Server in the level blueprint, you’ll have to do it on an actor that is owned by the client (playercontroller)

Server RPCs can only be called by a client who owns the actor executing the event graph. For example, a PlayerPawn is owned by the client who controls it - only that client can send Server RPCs on that pawn. The pawn also may own weapons, abilities, inventory items, etc (this is game specific). This can be a hard concept to communicate directly in blueprints. It is something we will work to improve as time goes on.

An explanation by staff where I found this answer after failing to get it to work myself on the level blueprint, but getting it to work by calling it in the characterBP:

what do you think is the worst thing that could happen if I change the owner in c++

The answer by vanlacke is correct, but for anyone who would like to keep level logic in the level BP and still run RPCs, this is the way I work around it without creating a set of RPCs for everything.

In my player controller I have a generic passthrough RPC, that can be re-used with a different ID:

The player controller and the level BP implement a blueprint interface with the “Level Event Requested” call in it.

Then in the level BP, I’d go like this:

216785-levelbp-rpc-01.png

(The “RequestingPlayer” input is not necessary but can sometimes be useful when doing multicast events)