RepNotify in a custom component not working

Thanks Carlos!

It appears I was incorrect about how OnRep is handled in Blueprints, and Carlos has it right: values need to be changed on Server to replicate to Client, even in Blueprint projects. Changes on Client are not replicated to Server.

In Carlos’ sample, he performs RunOnServer event in PlayerBP, which IS owned by Client. Then Server makes variable change, which is replicated to Client. This is how you’d want to handle any communication from Client to Server. There’s some good documentation on ownership here, for reference:

and a bit more in-depth here:

wow thank you carlosBC,
I cant say that i understand BP but iam going to study it :p.
But does this method also works when you have more things to do with ‘use’ button like opening doors and such because then your playerBP will be filled with all these little bits of “code”. Or is it just way it goes? Again thank you for your help!

“It appears I was incorrect about how OnRep is handled in Blueprints” do you mean by that that calling onRep on an random actor does work when you type it in c++?

In my code, when character collides with lamp, character saves that actor reference.
If character collides with more than one actor, it will only keep reference of last, so it will only interact with last.
You can use this system to interact with any other actor, for example, to make a door you only need to change “On Rep Lichtann” to do your door action.
But you can use other system, for example, when player press “Use”, you check with a sphere collision what actors are colliding, and interact only with closest.