[Solved] Change object animation based on objects around it

For example here I am using Tiled, but in the implementation (in gdev) it will be lots of Soil object that is arranged closely.

Here the grass is lined up seamlessly.


When I change 1 of the Soil object animation from “grass” to “soil” how to make other Soil object adjust their own animation to adapt with the change?
From

To

I only change 1 Soil object (A) and the other Soil should adapt to it, how to do that?
Can’t find the solutions, can only think of using object variable and assign row and column position and work with that number.