Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Tree Colliders

Discussion in 'Editor & General Support' started by manno, Jun 29, 2011.

  1. manno

    manno

    Joined:
    Jun 29, 2011
    Posts:
    5
    What's the best way to create colliders for trees that act as triggers? I know how to make collision colliders for trees, but not trigger ones. We have a lot of trees in our game and we need to make them all triggers, any suggestions?
     
  2. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Hmm. Maybe you could place the trees manually? It kind of defeats the purpose of a terrain though... Sorry I'm stuck on this one!

    Oh and welcome to the forums!
     
  3. Grady Lorenzo

    Grady Lorenzo

    Joined:
    Jan 18, 2010
    Posts:
    407
    There is a setting on the terrain script that says "generate tree colliders". However, I have yet to see a difference...
     
  4. manno

    manno

    Joined:
    Jun 29, 2011
    Posts:
    5
    Hi Grady, so to create trees that can collide with objects you need to:

    1. place your tree model into the scene
    2. assign a capsule collider to that tree
    3. adjust the collider to fit the tree as you want it to fit
    3. create a prefab from your tree+collider object
    4. in the terrain editor -> tree painting menu add a tree and use your tree+collider prefab as the tree model.

    Thank you for the response SomeGuy22, yeah it's beginning to look like that. I have been just running around the scene adding sphere colliders to the tree canopies, but there are a LOT of trees and it's extremely tedious. Here's hoping...
     
  5. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    I second that.
     
  6. manno

    manno

    Joined:
    Jun 29, 2011
    Posts:
    5
    see my 2nd post it will explain how to get this option to work.
     
  7. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Actually, I've tried that before and it didn't really work... But I think I was using mesh colliders so I don't know.
     
  8. jumper

    jumper

    Joined:
    May 28, 2011
    Posts:
    3
    This method seems not to work anymore, I have tried this and once it is painted on to the terain, is no longer has the collision functionality.

    Any help on this would be fantastic, as i have a thousand trees, can't really do them manually.

    Thanks
     
  9. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    From another thread:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Penna is right. I don't know why, but Capsule Collider works as part of terrain, and Mesh Collider doesn't. Perhaps because as part of terrain, they lose their individual mesh and get merged into one?
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
  10. sjurick

    sjurick

    Joined:
    Jan 2, 2013
    Posts:
    16
    Seems to me that statement cannot be true as it would defeat the whole purpose of them putting a "Create Tree Colliders" check box in the Terrain Collider. I'm using 4.2.1 and the trees still don't collide with anything... Have to manually put them in places where you "know" the player will most likely run into them, and leave the painting or mass placing of trees to areas where they won't.

    Would be nice to see a Unity representative speak to this issue.