Unreal Engine 5 · Blueprint → C++
RepNotify (ReplicatedUsing) in Unreal Engine 5 C++UE Docs
A RepNotify Blueprint variable becomes UPROPERTY(ReplicatedUsing=OnRep_Health) in C++, paired with a UFUNCTION() callback like OnRep_Health() that the engine calls on clients whenever the value replicates.
Blueprint node & C++ equivalent
// .h
UPROPERTY(ReplicatedUsing=OnRep_Health)
int32 Health;
UFUNCTION()
void OnRep_Health(); // runs on clients when Health changesWhat is RepNotify in Unreal Engine?
RepNotify is a replicated variable that also fires a callback function on clients each time the value changes. It is ideal when a value change should trigger a reaction, such as updating a health bar UI or playing a hit reaction, rather than just storing the new number.
The C++ equivalent
Declare the property with UPROPERTY(ReplicatedUsing=OnRep_Health) and add a matching UFUNCTION() void OnRep_Health();. The ReplicatedUsing specifier names the callback the engine invokes on clients when the property arrives.
Like any replicated property you still register it in GetLifetimeReplicatedProps with DOREPLIFETIME. The UFUNCTION() macro is required so the reflection system can bind the OnRep function.
When to use it
Choose ReplicatedUsing over plain Replicated whenever a client needs to do work the moment a value updates. Note the callback runs on clients only by default; the server changes the value directly, so call the OnRep manually on the server if you want identical behavior on both sides.
Frequently asked questions
How do you set up RepNotify in UE5 C++?+
Use UPROPERTY(ReplicatedUsing=OnRep_YourVar) on the variable, declare a UFUNCTION() void OnRep_YourVar(); callback, and register the property with DOREPLIFETIME like any replicated property.
When does the OnRep function get called?+
The OnRep callback runs on clients whenever the replicated value changes and arrives over the network. It does not run automatically on the server; the server sets the value directly.
What is the difference between Replicated and ReplicatedUsing?+
Replicated only syncs the value. ReplicatedUsing=OnRep_Func syncs the value and additionally calls your OnRep function on clients when it changes, letting you react to the update.