This seems a very basic and stupid question, I just loaded an array with instances, and now I need to perform very simple operations, like get the first one, or get a specific index from the array.
The only array functions I can see here are quite… fun (lack of a better word).
The GET returns a copy, I need the actual reference, not the copy.
The random instead returns the reference, but I don’t get the exact value I want.
Is there a way to do a “Get” and it returns the reference? Looks like a very basic feature that most of the cases should use IMHO.
For things like Instances, the array will contain pointers to those instances rather than the whole class itself.
Passing a Reference to a Pointer is a bit redundant - that’s why for things like that you don’t see the “Get (ref)” node like you do for actual values.
index 9 will be a pointer, not a copy of the instance - the array “Get” will return a copy of the arrays pointer, but that pointer still points to the original instance , in the test below note that both the second read from the array and the actual object return the updated value:
“For objects you always get a reference, the tooltip of Get here is misleading. Despite the returned object being a “copy” only, changes made to this item will be propagated back to the array.”
I need to check but is a big deal such a misleading message, to have a copy in server/client games would make a huge difference, need to try it out but it seems to be the answer.