OnTriggerEnter/Exit not called for Terrain Trees

It seems that OnTriggerEnter/Exit is not called when a collider enters or exits a Tree collider on the terrain.
I have a tank that drives forward and when it collides with any prefab it will backup a little, then Instantiate a gameObject with just a box collider on it and rotate this box around the tank until OnTriggerExit is called. Then it knows this place is free and will rotate itself and drive for that position. This works for Prefabs i might manually place in the scene including this Tree Prefab. But when i use the same Tree Prefab on paint it on the terrain this function is not called.
This will work if i place every tree manually in the scene, but i loose the variations that the terrain applies to the Prefab. Here is a video of the tank negotiating a Tree Prefab manually placed in the scene.

And here is one where the same Prefab is used but placed onto the Terrain using the terrain tools. As you can see the collider trigger is not called when it exits the tree.

Does anyone know about how OnTriggerEnter/Exit works with the Terrain?

From my experience, trees and grass behave in a rather unintuitive way. They have collision, but it doesn’t interact with triggers. The work-arounds I found for this were:

  1. Place your own collider at the tree locations. If you are placing trees via scripting, this is easy to automate. Not so much if placing manually.
  2. Create a prefab of your own that includes colliders. This removes the option of using the terrain tools, but still works with placing trees via scripting, though a different method than from the first option

i’m using option 2 that you described with a mass placement tool from the assets store. This had me for a couple of days tying to figure out what was going wrong. Thanks for the reply

It still doesnt work for me. When tree is put into scene the ontrigger is not invoked. Collisions work but trigger dont.
Putting my own collider with trigger doesnt help OnTriggerEnter anyway.

Is the tree being instantiated inside a trigger? I seem to recall that not reliably working…

Make sure that the “IsTrigger” is checked on the collider that you are using. When “IsTrigger” is checked then the collider will pass through other colliders, but if you want it to physically react to the collision then uncheck “IsTrigger” and use the OnCollisionEnter method to have your code run - i think.