(If you ask why I took the reference of the original array just to return another it is because at first I wanted to modify the original array but I had the weird behaviour, the screen was took in middle of my tests to fix it)
But I don’t know why, when I tried to use the node it was like this
There was no input and I don’t know why 2 outputs
So I tried some things but it is when I removed the “&” of the input TArray<> that I finally got the node that I wanted with 1 input 1 output.
I know that in a C++ function the “&” takes the reference to the original element and not a copy, is it linked to this behaviour ?
My problem is fixed now but if someone knows why it was a problem in the first place I would like to know.
Thanks
This macro tells Unreal to treat your array reference parameter as an input and lets you modify the input array in-place instead of returning a copy.
You would use this when you’re making changes to Arrays which can be quite large (think hundreds or thousands of entries). It’s generally safer and easier to reason about Arrays when you return copies, as RecourseDesign showed.