Hi,
So I created an event dispatcher and when I try to pass in an array, it gives me a Note Error. I’m not sure why. I understand that arrays are technically pointers/references but why would it give me that note? Is there a way to get rid of it or a workaround, or should I just deal with it?
Depends. A dispatcher will make a copy of the data even if you:
When you receive the array on the other end, and try to:
This will not work. This array will stay at its original size +1, the changes will not be propagated all the way back to Objective ID
.
So it’s OK if you can work with a copy of the data; it’s not OK if you want modify the actual array.
To make the issue more explicit:
This often does not matter much for an actor reference, as it would still point to the same actor. But if you modify the value of copy of the reference, the original one will be unaffected.
This is a major gotcha with Event Dispatchers.