RepNotify from c++ confusion.

One key difference between how blueprints and C++ handle the “rep notify” concept is that in blueprints any time a RepNotify variable is set, the OnRep function is automatically called on the server (and on the client when the update happens). In C++, the server does NOT automatically get the ReplicatedUsing function called, only the client does when it gets its update. If you want the server to call that function, you have to do so manually. I’ve had a decent number of requests to show porting the last 2 parts of the blueprint networking tutorial to C++, so I’m hoping I can do that some day soon when I find some time.

Also, whenever you are changing health, you’ll want to make sure you’re only doing so on the server. If you aren’t already, the C++ equivalent of the blueprint macro node for checking authority is:


if (Role == ROLE_Authority)

1 Like