How to check which terrain the object is over?


I want to check which terrain my object is currently over, to aid in performance improvements. I have ± 100 terrains in my scene with all the terrian colliders turned off.

I see this unity answer Best way to check which terrain im over? - Unity Answers but that needs the terrain collider already enabled.

Is there a way to test which terrain the gameobject is on then enable the terrain collider for that terrain using a Javascript?

Any info would be much appreciated.


I would try simply checking my object’s position relative to the Mesh renderer’s bounding box for the terrain.