I’ve got a feature request. So I’ve been working with repnotified arrays for a while on a project. Now the issue with this is whenever it set’s array elem it doesn’t repnotify.
Is it possible to have an option on set array elem to repnotify? This would be awesome as i wouldn’t have to “set array” after all the actions. If this isn’t possible in the way that replication works then just ignore this. Just an idea!
I think the reason this doesn’t work is because in order for the Property Tracker to see what values have changed, it needs to check them and compare to previous value each time it’s considered for replication. For an array, that would mean looping over all of it’s elements and storing a copy of it somewhere to see if it had changed that tick. On large arrays that could become pretty expensive.
What you could do instead, is when you set an element in the array, replicate a second ‘bool’ variable called bArrayIsDirty - and setup your ‘RepNotify’ function to respond to that variable instead. When it does, do stuff with the array and set bArrayIsDirty back to false (server and client side).
Give the second option a try but if that still doesn’t work then I’m just talking garbage
Yea that sounds logical, was just a question And the solution might work… It’s not amazing, but it’s something. It will work by the way i hear it so it’ll be good and probably shortcut my code a bit
I had this issue a while ago, I just create my own setter functions where I add/remove an element and once I’ve done that I just set the whole array equal to itself, which triggers the repNotify then.