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. Dismiss Notice

Question: Cutting hole in Terrain?

Discussion in 'Editor & General Support' started by CelticKnight, Jul 15, 2017.

  1. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    378
    Hello All,

    I've been looking into way to create a tunnel for a project in Unity. Bassically I want to create a tunnel through a small hill in the terrain. And I've run into a dead end with everything I've tried.

    What would be the best way to accomplish this? Would I need to make the whole thing a model somehow in (God forbid) a program like Blender? Goodness only know how I would go about making a hill in that thing or maybe a little better SketchUp at least I know how to texture items in that program (well sometimes it works).

    And advice is greatly appreciated?

    Thanking you in advance.
     
    phobos2077 likes this.
  2. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,968
    It isn't possible with Unity terrain. You need to model it yourself or use a third party terrain system. The Unity terrain is simply height based. No overhangs or holes or anything like that.
     
    CelticKnight likes this.
  3. guillermoi

    guillermoi

    Joined:
    Sep 20, 2012
    Posts:
    27
    Hi.

    Maybe you can fake it with a fade/load screen when you cross the entrance/exit of the tunnel ?
     
    CelticKnight likes this.
  4. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    378
    Thanks for your reply. I wasn't sure of the capabilities of Unity's Terrain system so thanks greatly for explaining it to me :cool:.

    I forgot to mention it was for a car racing game so it would only be a smallish tunnel, not something I could use to load another scene. But that could be a good idea for when I get back to other projects like the RPG and FPS I have going on. Thanks for the tip! :D.
     
  5. guillermoi

    guillermoi

    Joined:
    Sep 20, 2012
    Posts:
    27
    No prob.

    You could also mix unity terrain with a model of the hill with the tunnel on top of the terrain(the terrain is flat in that area and you drop the hill on top). But maybe it's difficult making it seamless .
     
  6. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    378
    Yep - that's exactly what I've been working on :cool:. I managed to find a hill mesh so it's not fully solid and then getting a model of a tunnel and using that to cut a hole in the hill mesh in SketchUp - and like you said putting it on a flat surface of the terrain. And then adding the terrain grass and normals to a material and adding to the hill the hill after being imported. It's not as bad as I thought it would be especially after adding the material and messing with the settings. Unfortunately there are some points where the mesh drops to the level of the tunnel causing some unpleasantries, but, I don't know how to make my own meshes in a modelling program, so, I'll live with it :cool:.
     
    phobos2077 likes this.
  7. Nateply

    Nateply

    Joined:
    May 20, 2014
    Posts:
    46
    Try putting a trigger at the cave entrance that disables terrain collision (or car collider) as the car runs into the hill so it passes through. Reenable it once it passes through. Put the tunnel just inside. Paint a hole on the terrain at the cave entrance. Fake the transition with camerawork. Have not tried this, but it might work.
     
    Last edited: Jul 17, 2017
  8. CelticKnight

    CelticKnight

    Joined:
    Jan 12, 2015
    Posts:
    378
    Can honestly say I never thought of that :p. That would be interesting to try out though!