Is there a way to check if something was snapped on a specific grid?

Here’s the thing.

I currently have a large(large-ish) grid, with expandable areas. I would like for each expandable are to be composed of x*y grids and for any player to be able to place and/or move the objects according to the grids.

I already found a tutorial of some sort showing me how to move the object based on the grid’s dimension (hope it’s good though).

I would like to know if there is a possibility of checking if a specific grid already has an object snapped to it? (this is to make sure that it’s not possible to snap two things on the same spot).

Regards

This is entirely dependent on what code you are using for grid snapping. You would do a check that something is not there, before allowing snapping of the current object you are moving. Or perhaps you would allow the snapping, but make the object red and not allow it to be placed.

There are several ways to check if there is an object there. You could have a trigger/collider on the already snapped object, that registers a trigger collision with your cursor or whatever you are moving around. Another way, is if you have an array storing all of the grid cells, you could have a boolean that says whether it’s used (or if the type of object is stored in the array, you would just check if it is empty).