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

Going Through Terrain

Discussion in 'AR/VR (XR) Discussion' started by jtdolan, Aug 15, 2015.

  1. jtdolan

    jtdolan

    Joined:
    Aug 15, 2015
    Posts:
    5
    Hi, I'm pretty new to Unity and am just trying to figure out how to make it so that when I am moving the camera around it doesn't go through the ground because that would obviously not make for an immersive experience. Any and all help is appreciated very much! Here are some screenshots of my problem. It is a before and then after traveling shot.

    Before:

    Screen Shot 2015-08-14 at 10.36.56 PM.png

    After:

    Screen Shot 2015-08-14 at 10.37.31 PM.png
     
  2. AaronXRDev

    AaronXRDev

    Joined:
    Dec 13, 2014
    Posts:
    30
    You could maybe add collision to the terrain and then assign a collider to the VR camera.
     
  3. jtdolan

    jtdolan

    Joined:
    Aug 15, 2015
    Posts:
    5
    Unfortunately, that didn't work and I still have the problem, but thank you so much for the input! I appreciate it greatly!
     
  4. jtdolan

    jtdolan

    Joined:
    Aug 15, 2015
    Posts:
    5
    Also, if anyone knows or can find another forum that explains the issue and solves it, please drop a link. I couldn't find one but if someone could that would be great!
     
  5. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    hey, what version of unity are you using? I did see this issue once with one particular version. It happened randomly after creating a new terrain. No matter what I did I would fall through terrain. Ended up making a new map with terrain and didn't see the issue. I would try updating to a new version of unity if you haven't and recreating the map from scratch. or Make a new test map with new terrain to see if that works. If you don't want to loose your work so far, try exporting the heightmap and then importing it into a new terrain.
     
  6. jtdolan

    jtdolan

    Joined:
    Aug 15, 2015
    Posts:
    5
    Thanks for the response! I am running Unity 5.1.2f1 Personal Edition. Just to be clear, the problem isn't that I fall through the terrain, but rather that I can travel through it. Also, I know this is a stupid question, but how do I update Unity or check for one? I am on Mac by the way.
     
  7. McGunn

    McGunn

    Joined:
    Aug 7, 2012
    Posts:
    33
    What you're asking for here is a way to do collision detection. Probably your best bet as a beginner would be to just use the physics engine to achieve what you want. You can learn about that here:
    https://unity3d.com/learn/tutorials/topics/physics

    What kind of code are you currently using for the movement? transform.Translate?