Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Despawning terrain trees on collision

Discussion in 'World Building' started by CoreyUNITY, Jun 2, 2021.

  1. CoreyUNITY

    CoreyUNITY

    Joined:
    Mar 15, 2014
    Posts:
    4
    I want to be able to 'harvest' trees when I collide with them in my vehicle. When I've added the (speedtrees) using the terrain tool, the oncollisionenter function only recognizes them as terrain. Would I have to place them as prefabs individually to detect them and modify the individual tree object? Is there a way to do this with the painted tree tool


    EDIT:
    I have found a solution here:
    https://unityshark.blogspot.com/2016/08/destroyable-terrain-trees-in-unity.html

    I will need to heavily modify it for my purposes, and to provide better performance. As well as a way to get it to work within photon networking.
     
    Last edited: Jun 2, 2021
unityunity