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:

https://forums.unrealengine.com/core/image/gif;base64

[ATTACH=JSON]{“data-align”:“left”,“data-size”:“full”,“data-tempid”:“temp_184793_1582876975847_617”,“title”:“20200228_165338.png”}[/ATTACH]

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!