Object sprite changes

Hello guys I am working on a project but I have a little problem (I’m newbie).I want it to check whether there is soil on the lawn, if there is any, I want the soil to turn into grass, and in its grass to soil.Can someone help how to do it? (My English is not good sorry)

You can try using Physics.OverlapBox/Physics2D.OverlapBox method to get all colliders in a certain region, let’s say the lawn. Then you can iterate through those colliders and check which ones have a soil component.

Here are a few references you might find useful: