Search Unity

Dig trenchs on terrrain

Discussion in 'Editor & General Support' started by hacker9001, Aug 30, 2018.

  1. hacker9001

    hacker9001

    Joined:
    Sep 28, 2017
    Posts:
    12
    I want to dig on a exact height from bottom of the trenchs to terrain surface .how could i?Exsample the trench is all 3 meters deep on any part on a complex terrain
    sample height from terrain tool cant do that.
    Thanks
     
  2. hacker9001

    hacker9001

    Joined:
    Sep 28, 2017
    Posts:
    12
    Upppppppp.anyone?
     
  3. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,433
    You will likely have to manipulate the terrain height-map data yourself. You will need to understand how far away a given point is from your trench's center, or if the given point is inside a trenching tool's collider, to see if that point should be dug or not. Then you need to figure out how much "three meters" is in the terrain units given the current scaling factors. Then just subtract that from the depth at each point.