How to make client change variable valuable to the server (with event “Run on server”) ?

I have an enemy blueprint called ‘ZombieGeneralBP’ and when it collides with a projectile spawned by the player it should change its variable called ‘health’. Using ‘OnComponentBeginOverlap’ I cast to the projectile actor, and check if who spawned it, player1 (server) or player2 (client). Then it should change the value of the variable ‘health’ but the client does not change to the server, and the server only changes when ‘health’ is set to replicate. What is wrong in the blueprint:

I also tried this:


The server updates the variable, the client does not.

You’d need to pass in the overlapped actor to the server. You can’t just cross the pins from the client function to the server function. The object needs to be passed in via the function.

Besides the health change should happen on the server and not the client. Do not trust the client with information regarding health. You can do a onrep notify for the health change that would call a function to update the UI if needed on the client.