Problem with adding elements to an array.

Hi,

I just played around with some Blueprint stuff and have the following problem:

When I add an element to an array “directly”, that is: in the event graph, it works:

b276c7cffe3e74fad0cb048a1d1b2b4c4c293c7d.jpeg

In the game, the array gets filled:
7257eb8900714496333f06595a42a1f639aa6712.jpeg

**But: ** When I do this inside a function, the array does not get new elements added :frowning:

be5b4c216a5cba3493d488858c2744bb2c8f95ae.jpeg

What am I doing wrong here?
The function looks like this:
e184434b313b8dde1c7c85f0b5e2c01e7b82e8f2.jpeg

But all I get in the game is:
ecce107de2d523ef2f795be47f34a2bef2afa755.jpeg

Why is this not working :confused:

Any help is appreciated :smiley:

Cheers,
Klauz

Hey Klaus,

This is your alter ego from tomorrow. :smiley:
I just found out whats wrong.
You need to either mark the function inputs as “passed by reference” and not by value (as it is default),
or, you put a “set member” node after the function call and thus explicitly replace the data.