Terrain gateways

I wanna make mountain with a road through it. Is it possible to make a gate in my mountain (terrainmade) so i can place a tunnelmodel trhough my mountain? Also the collider of the terrain has to behave correctly for my car, else i cant drive through it;) thanx already for any suggestions!

No support for terrain holes in Unity, sorry.

You can only modify surface elevation of your terrain in unity. If you want to make a gate, you have to use a additional mesh.

There is a cut-hole script on the wiki shader section which can do just that, however you will need to use a script to enable/dissable collision between the player and the terrain when the player should enter the tunnel. You can place a trigger covering the opening of the tunnel and make a script which dissables collision with the terrain when the player enters it and enables it when the player moves out of it.

Here's the shader: http://www.unifycommunity.com/wiki/index.php?title=DepthMask You might need to change the shader to affect the terrain though, right now it does only change objects with a certain shader (also on that page) but not other objects.

The simplest way is: build a steep-walled valley, with the road, in the terrain and place a 'bridge' mesh over the road that connects the two valley walls, forming the peak of the mountain. Texture it and model it to look like the terrain.

I don't know Unity well enough to say for sure, but I bet it won't work right if your car needs to drive across mountain, above the road.

The other problem is visual: you will see a seam, or border, where the 'bridge' mesh penetrates the terrain - they will not blend smoothly. Hide these with foliage, careful texture painting etc. Since tunnels often have man-made structures at their entrance, you can hide the most obvious seam by building an 'arch' mesh that penetrates the terrain AND the 'bridge' mesh.

This is a 'hack' solution, but it avoids dealing with collision problems on the road. For driving games, the priority may be seamless physics, rather than perfect visuals.

Good luck


“Terrain holes” on asset store: