How to get an event to fire on server when in a new actor

How to get an event to fire on server when in a new actor.

I’m trying to get an actor to change a variable on a server from a client.

The script on the character look like this:

The script on the actor look like this:

325323-variablechange.png

However I cannot get this script to fire from the client.

It works if fired on the server.

What does RPC stand for?

RPC stands for “RemoteProcedureCall”, so RunOnServer, Multicast or RunOnOwningClient.

Hi, the only client that can call RunOnServer RPCs on an actor is the client that owns this actor. If any other client tries to do so, nothing will happen.

By default the client owns its player controller and its controlled pawn. If you know that there is only ever going to be one client that calls RunOnServer RPC on an actor (e. g. the equipped weapon) then you also could set the client to own that. For all other actors, just don’t call RPCs from clients on them, but build your logic in a way, that you directly send the client input to the server and then the server handles all the rest (and use Multicasts/Variable Replication to tell the clients about the results if necessary).

So in your case, directly after the “V” key input, call an RunOnServer RPC and inside that event execute what you currently execute after the “V” key.