Return node pass by reference for arrays?

Is there a way to return arrays with pass by reference in a function’s return node?

My Blueprint has 4 arrays that I need. See screenshot below. In order to better organize my code, I created a function that takes inputs and returns the arrays I need based on my inputs. Sometimes I need index 0, sometimes index 1, etc etc. But I notice that my return node in my function only returns a copy of the array and not the original. There doesn’t seem to be a way to have the return node use pass by reference. Any idea how to do that? A work around to getting this working is to put all of this funciton’s logic in the main blueprint, but it’s big and ugly and I want to hide it in a function… which is why I made a function for this. It seems really silly that pass by reference is not allowed in a return node. Any ideas on how to fix?

Screenshot 2024-08-06 at 11.49.01 AM

Not possible with a function in BP
You can use a macro instead, which should work as expected, but can’t be called from outside of this BP

Similar problem here:
Select Node with Set Array Element - Programming & Scripting / Blueprint - Epic Developer Community Forums (unrealengine.com)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.