RTS Grid Idea?

Hi, i’m making a cartoony RTS game but have a problem on making a grid.I have know idea how, my first try was i created a square and added 4 cubes on each side, the cubes on side was hit by a raycast from the mouse position,when i hit a side of the cube, depending on the side, it would face different ways. although this works i was wondering if there is a better way of doing this?

Thanks

I did a grid for my game once (hex, but that doesn’t matter) and the implementation was a simple two dimensional array. To get the tile you are clicking on, you will have to divide the transform.position components of the raycast point by the grid width and cast the result into an int. If you want to place something on a grid point, take that int and multiply it with the grid width.