I’m working on a procedurally 2D path generation and my problem is that sometimes the path crosses itself and I don’t want that to happen.
As a solution to that, I wanted to get the x y coordinates of the rooms that are instantiated and store them in an array whenever a new room is instantiated and check if the new room position isn’t in that array. But I cannot find out how to do it. Can you please help me with this?
- How to get the position of instantiated object?
- How to store the positions in an array?