I greatly appreciate your help from last time, but there’s still a very annoying bug I’ve spent hours trying to fix… The problem is, sometimes pathways will spawn on one side, but not the other, and I can’t find the cause of it @JR01
It looks like if you update the raycasts to use strait angles (0,90,180,270) that it doesn’t cause this issue. All the raycast angles have an additional 10 degrees to these angles.
If I use straight angles, the raycast would not hit the room, because the pathways would be strait across, and they’re just empty space. In order for the generation to work, the raycast has to hit the room, so thats why I have the raycasts offset by 10 degrees @JR01
There’s really not much I can tell on what’s going on with the code. It looks like the world generator objects are getting out of hand as it keeps spawning more generators as you move screens. If you move to rooms like in a S shape pattern, you can see rooms getting overwritten from the additional spawned generators.
I’m not sure what changes to the code I could suggest, but I strongly think additional spawners and raycasts are not a good method as a room generator. I would recommend just having a single object that create a 2d list of all the rooms that you want and spawn all the rooms at once instead of endlessly spawning in more rooms.