First of all I’m very new to Unreal and programming/scripting in general, so please excuse my ugly node structures.
What I’m trying to do, is set up a tile that is 9x9 in size, and for any given tile, get a list of 8 tiles around it (up, down, left, right, then each diagonal direction)
The tiles are set up in an array of 81, so that tile on the right side of any tile would be i+9, tile above would be i+1, so on and so forth.
So here’s a function I have set up to retrieve indices of 8 tiles around a given tile:
To add some more information, this is how this function is being used:
Now, for some reason this “Search Nearby Indices” function runs infinitely, not stopping after adding 8 items as intended. Instead, it keeps adding the same 8 items to the list over and over in an infinite loop–can someone help me find out what the problem is? Thank you!