I want to make an overlay over a selected area, where each square has a color, wich represents the occupation of the area below, so when there isn’t something below that tile, it’s red, and when there’s something, then it’s green, how would I go about it?
I can tell you how i did something similar that you might be able to use. I created a grid of vector 3’s above the area. i then sent a raycast down from each vector3 position. You can then assign some subroutines to run depending on what the raycast hits and where it hit. eg You can just spawn a cube or whatever at the vector3 position and assign red if it hits a collider or green if it doesnt.
hope this helps.
The only problem with this, that this is very resource expensive. My selected area can be at most 10 X 10, and thats 100 transparent cubes.