Trees collide but says collided with terrain

So I added some trees to my terrain using the mass tree tool. I had already created a prefab for my tree and added a capsule collider to it.

So I edited the settings of the trees for the terrain and set it to use that prefab.

Note that the prefab has the tag Tree and the terrain has the tag Ground.

However when the player collides a tree, the log says it collided with the terrain, not with tree (I print the tag of the collider’s gameobject). I don’t want this behaviour because I do things depending on where the player hit. Is it possible to fix this?

,Do you use different Layer for your trees and your terrain ? If you don’t you can try this:

In Edit->project settings->Tag you can add Layer, create one for the tree and one for the ground for example.

Then in your tree prefab change the Layer (top right in the inspector) for the Layer you create for the tree. Do the same with your terrain with the appropriate layer.

Then in Edit->project settings-> physics you can choose which layer collide with tree Layer and Terrain Layer.

You can also add a script with the method OnCollisionEnter(Collision collision) and in this method add the condition if(collision.tag == tagYouWant) or if(collision.tag != tagYouDontWant).

I found the answer. I move the player using translate (not velocities), so it is not detected. I’ll have to change it.

If anyone stumbles upon this same problem this is the answer: