Blueprint function call modifying multiple actors?

So what I want to do is to have connecting players be placed at specific tiles (marked with “IsSpawn”) but only the first player connecting is getting placed. This is the gamemode scripts:

This part of the script just finds all the tiles that are marked for spawning and stores them as variables.

This script is where things go wrong:

What’s happening is that the second branch evaluates to false, which it shouldn’t since it should be empty by default. What’s more interesting is that when the first “Place Player On Tile” function is called, the value of the second spawn tile is also changed, meaning that both tiles are now occupied when in reality only one player has been placed on a tile. As you will see below the place function sets the status of the tile to “occupied”, but it can also be set to “solid”. I tried setting it as solid in the function and then check what the second branch evaluates to when it is reached, and it was now “solid” as well :confused:

I’ve made sure that everything else is working well, both spawn points are stored correctly and if I debug the script they appear to be pointing to different tiles (“…_1” and “…_2” respectively), same with the inputted player and everything: they should be different objects yet it appears that they aren’t. The Post login event is invoked two times etc, I don’t know what’s wrong.

Oh and I just noticed I had some debugging stuff in the second picture, at the second branch both true and false go into the final place player function call just but it should just be the true branch going into the place function. I disabled the empty check in the place function just to see if the player objects were different, which they were. And if I did that both players are placed correctly on the two different tiles (but the second spawn tile was still marked as occupied before the second player was placed on it). Which means that the two spawn tile variables are indeed referencing two different tiles, which makes this very confusing.

And finally the “Place” script is as follows:

Solved it. Apparently I’m stupid and didn’t pass the Player to the “Place Player On Tile” function by reference. I guess I got too comfy when not using C++ :confused: