Search Unity

Tree colliders not working on mass placed trees?!?

Discussion in 'Physics' started by Domschaefer26, Feb 14, 2019.

  1. Domschaefer26

    Domschaefer26

    Joined:
    Feb 4, 2019
    Posts:
    4
    Help Please!!
    I'm not sure what's going on, but when I mass place trees even with the colliders enabled checked they do not have a collider on them. I can walk right through them. If I place the trees manually the collider works just fine.
    Any ideas as to what is going on here!!??

    Thanks for the help :)
     
  2. alphassrashid

    alphassrashid

    Joined:
    Mar 1, 2018
    Posts:
    1
    Hi,
    Make sure you have capsule Collider enabled and your prefab instance is Active in Project tab.
    if your Prefab instance is not active, terrain will mass placed your trees but colliders without colliders.
     
  3. Spartikus3

    Spartikus3

    Joined:
    Dec 27, 2013
    Posts:
    108
    Guys sorry about the necro but it seems like this is happening to a lot of people. I have had this problem since Unity 2017. I haven't worried about it but it's infurating as players find it so immersion breaking. I am now running Unity 2019 4.16 LTS. All of my tree prefabs are "On", all of my prefabs have colliders that extend just below the ground.. I rebuild the navmesh after placing... Can someone take pity on me please and toss me a bone on this?
    upload_2020-12-21_8-54-41.png
     
  4. Sievlar

    Sievlar

    Joined:
    Oct 3, 2012
    Posts:
    68
    The problem is the tree layers all adopt the same layer as the terrain. I.e. the original layer of the tree is ignored. That means the collision layer of the tree is the same layer as the terrain, which most people would ignore for collisions. The fix is to include the terrain layer for collisions, and then do an additional check in the collision code to determine if you should consider the collision or not. For example the impulse of the impact. That has a side benefit of having collisions with cliffs.