Thanks for 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 variable by reference to a macro and using Assign or Set value (by ref) nodes. value is changed, client gets notify, 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 starter content and it should be small enough. Thanks!
I reproduced 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 host in project attached below. All you have to do is to launch it as a single player, no need to form connections or anything else. map you launch firstly sets variable gently and prints prove it works well, then it proceeds to set variable through a macro and it fails although 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 code it looks like at first way of setting variable, there is simply added a virtual box in blueprint to directly call repnotify for that variable, which is not happening in second case, simply because repnotify is not defined inside macro but level above (blueprint calling macro) and it cannot find it thus it doesn’t call it.
I did find a workaround, I simply output variable from macro and use regular set outside of it, which is what you can do, macro is already prepared for that. When you add Set behind macro 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 quick reply.
UPDATE: 4.8.1 also fails to call RepNotify on host. Migrated project to new version, ran it, same problem.
Thanks for test project! I see what you were saying now, and I can reproduce behavior here. I have entered a bug report for issue (UE-18081) and I’ll let you know when I see an update on it. Thanks again!
Nvm My problem was that I was modifying a actor and not a character I had ownership of. issue was that if I locally modify a variable with repnotify selected, it will call local repnotify function but server will never acknowledge my modification of variable so 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 increment wasn’t working as expected.
Confirmed working without using “incrementint” node. Something is wrong with increment node; if I use increment node, only client receives OnRepNotify callback for some reason.
Still a problem in 4.25.2 ! Increment and decrement of a integer do not trigger repnotify on server. This made me lose so much time before I found out this problem, please fix!