Hey all I have a simple spawn function for a dungeon that will run traces along the ground and tell it to spawn specific tiles depending on what is hit with the trace.
However the trace circle has to be big enough to hit up to 3 tiles away. The problem:
The circles will hit the same tile multiple times, adding it to the array over and over causing the tiles to be spawned inside each other and causing heavy fps drops when approached.
As the tiles are hit and the conditions are met their location is added to an array and then they are destroyed or they are just destroyed or nothing.
But then I for each loop through the array and spawn a tile on each location. And since there are multiple copies of the same location they will spawn many times over.
The array is completely randomly generated every time and quite large; if it were to work correctly about 250-1000 HISMs. So I have no idea how to make it auto check against itself. I can’t manually tell it to avoid “x” duplicate(as it may not exist the next time it is ran).
Any help appreciated.