I’m seeing some different behavior on my end in 4.7.2. There’s a known issue with OnRep functions not firing on Clients, reported here, so I’m not sure how you’re getting that to work at all. When I tried using Add, it didn’t fire on either Client or Server, but I think that’s because it’s expecting a change to an existing value in array, and not an addition to array. I’ll have to check with developers on that.
But you’re seeing some different behavior. Did you upgrade this project from an earlier engine version? Are you able to reproduce this in a new project, or only your current project?
I was able to reproduce this in your project, and I’ve entered a bug with a copy of your project for reference (UE-12029). I’ll let you know when I see an update on it. Thanks for report and test project!
I’m wondering if this is same issue. I’ve managed to make my array replicate by using array ‘set w/notify’ (it was meant to be a workaround), but ‘OnRep’ function is only triggering for server.
replicating variables are housed in an Blueprint ActorComponent, so it’s similar to other one you had posted, but instead of variables not replicating at all, non-array variables are calling OnRep for both client and server, while array is only calling OnRep for server.
It seems like same problem, but I wanted to be sure before throwing my hands up and giving in to an engine bug. Thanks in advance!
I haven’t seen any progress on this bug report yet, but I know Network Team is making a push for a lot of networking bugs to be fixed for next version (4.8), and I expect this to be one of them.
still not working as it sounds like it should (4.14.1)
i call from a widget a event located in player controller. that event is set to run “on server”.
its adding to a struct array that is set to rep notify. notify function doesnt work correctly and will not be called on server. (not easy to debug so sorry for not perfect information)
So heres a workaround:
instead of [ARRAY]-[ADDTOARRAY] you copy your whole array into a array of same type.
set it to replicate, use add on it, and then SET your ARRAY to your tmp array.
so its like [ARRAY]-[SETARRAY2]-[ADDTOARRAY2]-[SETARRAY]
now on set array - rep notify will be called, and since add works fine on server (just not rep function) this works in end
its wierd that this is not being discovered and fixed really quick as it seems to be a low level problem that is great to unit test