- Home /
Making caves in the terrain - again, but this time with scripts
Hello everybody,
this is yet another question concerning caves in the terrain. I have found out so far that unity doesn't support this and I would need to hack around with creating a separate mesh for the cave, attaching it to the terrain, adding a shader to the entrance that stops the terrain from being rendered and add a trigger which disables collision detection to let objects actually pass through the hole.
Now, my question is: how do I do all of that from within a script? There are some (deep) holes/caves that I want to generate automatically.
So, for the collision detection: I would like to just create a trigger on the entrance to the hole, but how do I add a trigger to the terrain? I don't see any addTrigger or similar methods in Terrain, TerrainData or RigidBody. Same goes for adding the shader - I have found out that zou can pass one in the constructor to a RigidBody (so I guess I can do the same for a Terrain), but I haven't found out how to add one to the existing Terrain (and anyways, I would need more than just one)...
Are there any examples that would show something in that direction? Not neccessarily with holes or caves, just the techniques needed here.
Thanks a lot in advance!
Answer by 1elfdragon1 · Feb 23, 2012 at 11:16 PM
you can also use the tutorial on http://www.smokymonkeys.com/kyrill/index.asp?direct=22
use google translate to translate it.
here they explain how to use the script.
http://forum.unity3d.com/threads/77324-how-to-use-smokymonkeys-hole-in-terrain-script
Answer by Venryx · May 13, 2013 at 08:38 PM
There's a plugin for this on the Asset Store: Terrain Hole System
Description: "This Unity extension lets you make holes in your terrain that characters and other objects can go through."
More information can be found on the forum thread.
Your answer
Follow this Question
Related Questions
problem with cave interior 4 Answers
Make a simple tree 1 Answer
How To produce cracks on terrain and buildings with earthquake ? 0 Answers
"Terrain.activeTerrain" what does it do? 1 Answer
Bugs with Terrian. Unity 5.4.0f3 FIXED 0 Answers