How to detect when the player has filled a shape?

i m working 3D game…

In my game, the player is presented with a plane containing obstacles (orange / blue) and regions of empty space (white).

The player moves their green cube around the empty space, which instantiates a trail of green cubes behind it, painting the path they’ve travelled.

I need to detect when the player has painted all of the empty space, so that they can proceed to the next level.

When the player has painted all of the empty space:

Initial state of the board:

Currently I store my instantiated paint objects in a list.

But I don’t know how to check that the objects in this list cover all of the empty space. How can I do that?

I’m not 100% sure how you would be able to dynamically detect which areas your player has been to, but you could cheat the system a little here.

While not the best, a solution to this problem (Which might not work depending on complexity of levels later) you could have a large series of invisible objects that cover your white spots initially. As the white spots are overtaken by the green, they would be destroyed. This would be done by the invisible objects having a collider that is a trigger only, and will only react if the tag on the other collider is “Green Paint”, or something similar. Once they are all destroyed, then the level would be complete.