- Home /
Need help to detect nearby / adjacent tiles / objects whatever, without collision... HELP,Need help to detect nearby / adjacent objects to make them available for further commands.
I have a claiming system in my game, think of it as claiming land and I just want you to be able to claim land adjacent to where you already have claimed, which means I need code to determine if the land is claimable or not, so I need help to detect nearby objects or such basically, but the tricky thing I cant figure out is that I have to do it without collision cause otherwise it messes with the rest, dont ask xd. Please help, need a way to detect adjacent etc...
How do you define adjacent in your game? Is it hex, is it quad, is is it a terrain? How does it look like?
I mean, it is terrain, but the area right now is flat and the zones that you can claim are divided into Squares with small roads or such in between splitting them apart
You should use square coordinates then. If it is a grid, then define an origin point, which will be (0,0,0). then it becomes easy : if your current square is the origin, left square (-1, 0, 0) , right square (1, 0, 0), so forth, so on