Passing a Map variable via a Blueprint Function Library

When attempting to reference a Map variable via a Function Library, no values are added or stored within the variable.

Update: To clarify, when I say the engine doesn’t seem to allow this, I mean that the engine doesn’t seem to allow for you to reference this function in a subsequent blueprint and call an action against the Map. E.g. I have an Actor which should call this blueprint then increment the sort order within the InventorySort variable on the character state. The Actor (in the Event Graph) calls GetInventorySort. It then does an ADD on the provided Map node (e.g. the InventorySort map). However, NOTHING is added to the map.

1 Like

Note that my assumption here is that the Function Library is returning a copy of the map rather than the map itself. But I am honestly not sure.

That’d be the case. It’s not even about the library itself. If you explicitly pass-by-ref (note the funky pin icon):

It will work fine. But this will not:

image

We’re operating on the copy outside of the function scope.

1 Like

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