Check if another object exist in a position before respawning

Greetings!

Short problem description: I have an object that i'd like to respawn on my gaming board but do so in an "empty" place

Detailed description of my setup: I have a 2d chessboard like background (z=0 always), in this prototype the motion is done through scripting and the position x,y are always integers. I have three object type: Player (which is a cube atm of scale 1) , Many Obstacles (of scale 1) and a Fruit to pickup. Each of the object occupy a cell in my gaming board.

When the player enter the same cell as the fruit stuff happens and the Fruit respawn elsewhere on the board. What i'd like to do is having the fruit respawn in an empty cell not occupied by the player and by all the other obstacles.

Obstacles and Players have cube collider "is trigger" and rigid bodies.

In the Player Script i have

    void OnTriggerEnter(Collider otherObject)
    {

    if (otherObject.gameObject.tag == "Food")
    {
        //Debug.Log("We hit: " + otherObject.name);
        Food food = (Food)otherObject.gameObject.GetComponent("Food");
        food.ResetPosition();

    }   

}

and the function to reset position in the Food is

public void ResetPosition()
{
transform.position = new Vector3(Mathf.RoundToInt(Random.Range(-gameref.backx, gameref.backx)), Mathf.RoundToInt(Random.Range(-gameref.backy, gameref.backy)), gameref.transform.position.z);
}

What i'd like to add is do a check that the coordinate i'm resetting the position are "Empty", i already tried to play around with a bruteforce approach like putting an ontriggerstay and reset the position again but this doesnt seem to work for me. Any help is appreciated :) as you can see i'm using c#

Thank you! Fabio

since the positions are just integers, i think it isnt hard to compare positions, you can tag all objects that moves inside the chessboard, and compare all those objects to the current moving piece or the fruit you're talking about before instantiating it.

maybe something like this might work:

if(checkIfPosEmpty(targetPosition))
{
    Instantiate(fruit, targetPosition, Quaternion.identity);
}

public bool checkIfPosEmpty(Vector3 targetPos)
{
    GameObject[] allMovableThings = GameObject.FindGameObjectsWithTag("movable");
    foreach(GameObject current in allMovableThing)
    {
        if(current.position == targetPos)
            return false;
    }
    return true;
}