tree collider not working

I have added a capsule collider to a palm tree and made a prefab with it. If I instantiate this tree in my scene, the collision with the capsule collider works.But when I paint trees (this one) using the terrain feature, the capsule collider of the tree does not work…
I have Unity Pro 2.1.

Do you have the “Trees have colliders” Option in the Terrain-Script checked?

Yes, I have the “Trees have colliders” option checked. :?

Try selecting your Terrain, then choosing “Terrain->Refresh Tree and Detail Prototypes” from the menubar.

I have tried “Terrain->Refresh Tree and Detail Prototypes” but it does not work. I have tried the “Sycamore with collider” from the Terrain Assets Package and it does not work! It does not have collisions!!
And sure, I have" Create tree colliders" checked and I have refreshed the trees.
And like I said, the collision works when instantiated like any GameObject on the terrain.
I think the tree collider Terrain option is broken… :cry:

Any ideas?

If you refreshed prototypes, the tree colliders should just work. If they don’t, please upload your project using the bug reporter. (found from Help->Report a Problem)

Not to get too far off topic, but with the tree colliders is the collision just around the tree trunks or will you get a collision from the branches as well?

The only collider that works with a tree is the capsule collider. You can resize this collider to be as small as the trunk (whihc I think is preferable) or of any other shape including one which surrounds the tree canopy.

FYI the capsule collider is a primitive available to you in the editor.

Ok thanks for the info. My demo is long expired and I haven’t bought my license yet, so I haven’t been able to play with that kind of stuff… (spent too much buying a new mac modo had to wait on my unity license)

I think I remember the name right I was using a polygon collider when playing around with the trees.
I added it to the tree manually so it wasn’t with the terrain engine.

Hi guys! I got the exact same problem as angel_m and it seems several guys at the irc cant get the collision to work either. Ive browsed the forums and tried everything, but the collision just doesn`t work.
Is this a major bug in Unity 2.1 or can it be solved easily?

As were working on a project for a client, were under a NDA, so we can`t send it to the bug-report. How can we solve this?

EDIT:

I just tried to add a FPSWalker script to the camera and the camera collides with the trees. The problem seems to be the collision in the character controller, as the player walks straight through the trees. Any tips on how to solve this?

Roald

Yes, it is strange, I opened a scene I created with Unity 2.0 and the trees (the Sycamore with collider from Terrain Assets) I painted on the terrain has collisions (now in Unity 2.1)…But in my new scene created with Unity 2.1 the same trees prefabs (the famous Sycamore with collider :)) the collisions don´t work.

Interesting… I’ve been having the same problem. I have been able to place the trees manually and have the colliders work fine. Based on this response, I wonder if it has something to do with the collider attached to the character? I’m using box colliders and sphere colliders on the character. Doesn’t FPSWalker use a capsule collider? I’ll play with this some tonight.

Thanks,

Galen

Turns out that the tree colliders won’t work correctly if you have offset the terrain (they don’t follow the offset, so you should be able to collide with invisible stuff if your terrain is not too much offset). At least in my experience. Just posted a bug report on it. The problem is not only with the character controller, it is also present with regular Physics.RayCast and the FPSWalker-prefab (or whatever it’s called).

Edit: Typos

Thanks to ToreTank the problem is resolved. :slight_smile:
It is a bug in the terrain engine. If you change the position of the terrain ( I mean: not placed at 0,0,0 )
simply the tree colliders does not work.
Thanks.

That’s strange, I believe you, just strange. So, since the trees are rendered correctly, does that mean the colliders are also positioned, just offset from 0,0,0 rather than based on terrain offset?

Just make a trial.Create a simple scene with a terrain,with position 0,0,0 (default) and paint some trees with collider: they will have collisions.
Then move the terrain to -100,0,-100, for example, and again paint some trees with collider: they won’t have collisions…

Got a reply from the Unity guys earlier today, and they said it will be fixed by the next release. Dunno when that is, though :slight_smile:

angel_m: Glad I could help!

This still is an issue. An idea when it will be addressed?

Still broke for me too using 2.5 in Windows.