Quick answer: cam.layerCullDistances returns a copy. Modify and assign back: var d = cam.layerCullDistances; d[layer] = 100; cam.layerCullDistances = d.
You want grass on layer 8 to cull at 100 units. Setting cam.layerCullDistances[8] = 100 compiles but has no effect at runtime. The property returns a copy of the internal array; mutating the copy doesn’t affect the camera.
Reassignment Required
int grassLayer = LayerMask.NameToLayer("Grass");
float[] distances = cam.layerCullDistances;
distances[grassLayer] = 100f;
cam.layerCullDistances = distances;
The read returns a copy. Modify the copy; write it back. The camera adopts the modified array.
Spherical vs Planar
cam.layerCullSpherical = true;
Spherical means distance measured from camera position (a sphere). Planar means distance perpendicular to the camera plane (a slab). Spherical is more intuitive; default is false (planar) for legacy reasons.
Per-Layer Tuning
float[] d = new float[32]; // 32 layers max
d[LayerMask.NameToLayer("Grass")] = 50;
d[LayerMask.NameToLayer("SmallProps")] = 80;
d[LayerMask.NameToLayer("Buildings")] = 500;
// Layer 0 (Default) stays 0 = use far plane
cam.layerCullDistances = d;
Per-layer distances let you cull dense low-importance content close while keeping landmarks visible far.
Verifying
Walk away from a known grass instance. With cull set to 50, grass should disappear at 50 units while trees stay visible. Use the Scene view’s Show Stats to confirm renderers drop count at the threshold.
“layerCullDistances is a get-modify-set property. The copy-then-assign pattern is essential.”
Per-layer cull is a major perf win for outdoor scenes — dense grass at 30m, distinct objects at 200m+ — without dynamic LODs.