Hi there!
Well it is neither a feature nor a bug, it is an inconsistent behavior of Blueprint RepNotify on client and host, that can cause unnecessary execution overhead or unexpected issues. Did not find anything about this issue in here.
Content Examples Sample Project for Unreal Engine | Unreal Engine 5.3 Documentation :
Oftentimes, it is desired to execute
some logic in response to the value of
a replicated variable changing.
Variables that are marked RepNotify,
have a special function called
automatically any time the value is
changed, on both Network Authority
and Remote Machines.
So that means that OnRep only gets called if the variable is replicated by the authority.
And it means that it only gets called if the value has been changed.
That works for the client of course, but the host calls OnRep every time the variable is set (not even changed).
Further on as i can see when testing this issue: OnRep even gets called if the client itself sets the variable. No matter if changed as well. So you can run into a situation where the mix of Replication Event + Value Changed Event behaves completely opposite as intended.
It obviously means that the change-check is deep down the replication and not in the setter and that the OnRep call just happens when the variable is set.
=> You need to implement your own property setter to check for changes, before setting the rep property.
That OnRep gets called even if replication is not enabled for the blueprint, is a nice convenience feature i guess, but therefore i am sure you actually want to use it as change observer as well
Tested this with 4.10.4 and 4.11.P7: Actor (with/without replication) - With a float variable - Set variable every Tick (with/without authority/remote check) - In OnRep do a PrintText of the variable (with authority/remote checks)
I did not realize that since 4.8. At least i had no issues with that. I just realized it now when calling my own Property Changed Dispatcher in OnRep for calculating UI things… To actually… not scan the values every tick
Happy Debugging
Marooney