Grass: interaction¶
Put a Grass Interactor component on anything that should push grass aside. Blades bend away from it, curving over from the root, and stand back up over the quality asset's Recover Time, so a moving object leaves a wake.
The push is sized from the object's own collider (the first one on it or its children):
- its centre is the bottom-centre of the collider's bounds,
- its radius is the larger of the bounds' X and Z half-widths, plus Radius Padding.
| Setting | What it does | Default |
|---|---|---|
| Radius Padding | Extra radius around the collider's footprint, in metres. | 0.25 |
| Fallback Radius | Radius when the object has no collider. Its position is then the transform's position. | 1 |
The collider is looked up when the component is enabled. If you add a collider later, disable and re-enable the interactor.
Interactors stamp into one top-down trample map that follows the game camera: the camera tagged MainCamera or, with none tagged, the camera drawn last to the screen. Cameras that render to a texture and URP overlay cameras are never followed, so with a render-texture setup (pixel art, for one) tag the camera that sees the world. Every patch reads the map. The interaction settings are rig-wide, under PERFORMANCE > Interaction:
| Setting | What it does | Default | Shipped preset |
|---|---|---|---|
| Enable | Turn interaction on. Off, the grass grows straight through interactors. | On | On |
| Strength | How far blades are pushed aside. | 1 | 1.5 |
| Recover Time (s) | Seconds trampled grass takes to stand back up. 0 is instant. | 2 | 2 |
| Reach Height (m) | How far above a blade's root an interactor's underside can be and still push it. Anything higher passes over: a jump, a flier. | 1 | 1 |
| Tracked Area (m) | Width of the square around the camera where interaction is tracked. | 64 | 64 |
| Map Resolution | Texels across the trample map. Tracked Area / Map Resolution is the smallest push it can draw. | 512 | 512 |
Up to 64 interactors push the grass in any one frame. Interactors past the 64th are ignored.
To tint trampled grass, raise Trample Highlight in the look profile.