Flatten or cut grass when a large object rolls over it

I’m looking for an effect which appears grass is being cut or flattened when a large object rolls over it.
I’d like some kind of suggestion or direction to look into.

Thanks in advance

If you are using unity Terrain grass, then you are flat out of luck! Unity terrain grass is not an exact science, it just renders grass somewhat randomly… based on a what is called a detail map. A detailmap is found in code by terrain.terrainData.detailMap or something like that. It’s a triple array of ints that decides how much of each detail sprite you are putting in each small region of your map. This however is not precise. tiles take up an area, and the grass is rendered randomly in this area. Updating the grass mid-game is unadvised, not that I’ve tried it, but I’m guessing it’ll shuffle the grass around within their respective tiles.

HOWEVER, don’t give up hope yet. IF you want to keep using unity grass, I think there’s a way to combat against having your grass randomly jump around every time you edit the detail mesh… Detail Resolution per Patch claims based on its description to make your tiles so small that they don’t randomly place grass anymore. I’m not sure how much I believe that. Anyways setting that property to 1 should do the trick, as well as multiply your render time for the grass by about 8. You are free to check that path, but I don’t think it’ll go too far.

Alternatively you could make all grass in to gameObjects with small trigger hitboxes that swap out their sprites when you roll over them. That’d surely work, but unless coded in correctly, wouldn’t be to efficient.

Bonus: DetailMesh supports placing full GameObjects in and painting those to your map. Having a grass gameObject with the hitbox premade as a prefab and then throwing that in there will allow you to treat your lovely new grass gameobject just as you would a normal grass - hold the billboard effect ofc, which you’d have to manually recreate if you wanted that.