Accessing scripts / OnMouseDown in terrain detail meshes

Hi all,

Is it possible to access scripts on trees/detail meshes from the player? I have a tree prefab with a collider and a mouse picking script, but both OnMouseDown and raycasting seem to bypass the individual tree’s collider and pass the click to the terrain (which has a different click-handling system). In essence, what we want is to be able to collect data from various in-world elements, trees included, and it would be nice to use the tree painter rather than hand placing colliders on every tree in the scene. I do understand that Unity’s terrain system optimizes the heck out of terrain and may be collapsing the colliders into one, so if anyone can tell me if I’m barking up the wrong tree trying to use the terrain system for this purpose, I’d appreciate it. Thanks!

Any thoughts on this? It seems to have gotten buried.
-Andrew

I don’t think colliders and OnMouseDown will work with the details of the terrain system.

Maybe you can manage something like detecting the click on the terrain and check the splat map to see if it’s painted on that position.
This is only an idea, I don’t have tested it yet.