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!