Thanks for the report! I was able to reproduce this in 4.6.1, but it appears that it has already been fixed internally and should behave as expected in 4.7. Thanks!
It does not work when passing the variable by reference to a macro and using Assign or Set value (by ref) nodes. The value is changed, the client gets the notify, the server does not. Version 4.7.5
I haven’t been able to reproduce this issue in 4.7. Can you set up a test project and attach it here? Use a new blank project without the starter content and it should be small enough. Thanks!
I reproduced the exact same issue on a fresh 4.7.6 project without starter content. I’m downloading 4.8.1 right now to verify whether it works there or not.
RepNotify is not called on the host in the project attached below. All you have to do is to launch it as a single player, no need to form connections or anything else. The map you launch firstly sets the variable gently and the prints prove it works well, then it proceeds to set the variable through a macro and it fails although the value is changed.
You can also check whether it works with a function instead of macro or with ‘Assign’ node instead of ‘Set val (by ref)’. For me it’s broken in all those cases.
From the code it looks like at the first way of setting variable, there is simply added a virtual box in the blueprint to directly call repnotify for that variable, which is not happening in the second case, simply because the repnotify is not defined inside the macro but the level above (blueprint calling the macro) and it cannot find it thus it doesn’t call it.
I did find a workaround, I simply output the variable from the macro and use regular set outside of it, which is what you can do, the macro is already prepared for that. When you add the Set behind the macro the second way also works, although it’s quite problematic solution - expect everyone to remember to put set behind your macro so it works.
Thank you for the quick reply.
UPDATE: 4.8.1 also fails to call RepNotify on host. Migrated the project to new version, ran it, the same problem.
Thanks for the test project! I see what you were saying now, and I can reproduce the behavior here. I have entered a bug report for the issue (UE-18081) and I’ll let you know when I see an update on it. Thanks again!
Bug still exists in 4.9.1 Using the simple ++/-- operation in blueprints on a replicated variable wont call the notify event on the listen server - but on the client!
Nvm My problem was that I was modifying a actor and not a character I had ownership of. The issue was that if I locally modify a variable with repnotify selected, it will call the local repnotify function but the server will never acknowledge my modification of the variable so the repnotify on server and other clients will not be called.
Make sure you have ownership of your objects before you modify them.
Come on, guys, let’s get this fixed. This is still broken in 4.18.3 I believe. I have a very helpful little mini-macro I’d like to write, but I need to be able to set w/ notify on a variable passed by reference.
Incidentally, there was previously a bug on my project due to this problem, too. It took quite a while to figure out that the increment wasn’t working as expected.
Confirmed working without using “incrementint” node. Something is wrong with the increment node; if I use the increment node, only the client receives OnRepNotify callback for some reason.
Still a problem in 4.25.2 ! Increment and decrement of a integer do not trigger the repnotify on the server. This made me lose so much time before I found out this problem, please fix!