Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Terrain is really messing me up

Discussion in 'World Building' started by skyemagethe3rd, May 18, 2018.

  1. skyemagethe3rd

    skyemagethe3rd

    Joined:
    May 15, 2018
    Posts:
    6
    I'm pretty new to Unity and have been scouring this site and youtube videos to try to get as much information as I can. Each day I'm presented with a new problem and a solution. Today's problem is: Terrain. No matter what I do my custom model falls through the Terrain when I try to play. I've deleted and redone terrain so many times, and now my character is falling through even planes. I've racked my brain trying to find a solution, and I know it will be so easy I'll kick myself when I get it but for now, I need help.

    Here are some images of my settings so you guys can see what I'm doin wrong and help me to rectify it

    *Terrain:
    Terrain Troubleshoot Img 1 (terrain).jpg

    *Character:

    Terrain Troubleshoot Img 2 (character).jpg

    the question marks are because I have NO IDEA if those are supposed to be there as I saw a couple quick fixes to similar problems while searching for the answer and tried them out to no avail. As I'm on Unity 2018.1 Idk if the solutions for 2017 or even Unity 5 are supposed to help in my case. Please help so I can get back to trying to make my game thank you :)
     
  2. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,663
    The character falls through, because the Box Collider already intersects with the Terrain. No collision detection is happening, so your character falls through it. What happens if you move your character waay up and then press Play?

    By the way: Don't use a Box Collider for your character. Use a Mesh Collider instead and tick the "Convex" checkbox.

    Finally, remove the Mesh Collider from your Terrain. You already have a Collider attached to it - no need to have two :)
     
  3. skyemagethe3rd

    skyemagethe3rd

    Joined:
    May 15, 2018
    Posts:
    6

    So I removed Mesh Collider from Terrain, took out Box Collider as well as all of the 3rd person parts, added Mesh Collider to the character on Convex and moved her high up. Now she falls right through the terrain. I'm seriously confused as to what to do with Terrain

    **~~~ I guess I should state that before at least she landed on Terrain and moved sporadically while being frozen in a crouch state. Now she's in T state and falls right through Terrain where as before she had a few moments before she did
     
  4. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    Putting a mesh collider on your character is pretty unconventional. Usually characters, the first place we usually start is a capsule collider. Anything more complex, like a rag doll, we use a series of primitive colliders to achieve the effect.

    The only issue I see that may be causing your problem is that your box collider has almost no depth. The physics system doesn't deal well with super small objects, especially if your collision detection mode is set to descrete.

    Give your box collider more depth or better yet use a capsule collider. Box colliders with get stuck on small ledges.
     
    JoeStrout likes this.
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    In addition to what @chatrat12 said, the mesh of a character is not convex. Never click Convex on a mesh collider unless your mesh is actually convex. (And if you don't know what that means, then just don't check it.)
     
  6. skyemagethe3rd

    skyemagethe3rd

    Joined:
    May 15, 2018
    Posts:
    6
    any videos i can look into for convex you would suggest or just programming characters in gen.?
     
  7. lcfitz1

    lcfitz1

    Joined:
    Apr 27, 2018
    Posts:
    3
    Im having the same problem. Any luck yet with a fix?
     
  8. FragSalat

    FragSalat

    Joined:
    Mar 21, 2019
    Posts:
    2
    Me too. I couldn't find any tutorial whose is doing something different than me and I'm using standard assets as well.
    So using Unity 2018.3.9f1 I'm doing the following:
    - New Scene
    - Create Terrain GameObject in hierarchy inside new scene
    - Adding some texture and and making some actual terrain
    - Putting in a FPSController (tried third person as well)
    - Moving char way above the terrain
    - Run and see the char fall through

    As it is all default here the terrain got a terrain collider with default settings and the character got a capsule collider with default settings. The character also by default have a rigbody. I've just not changed anything so far and in all tutorials it's working^^

    Can anyone of you reproduce it?
    PS: I've recorded my steps to be most transparent and understandable as possible.


    Thanks in advance

    Best
    FragSalat
     
  9. Sun-Dog

    Sun-Dog

    Joined:
    Mar 23, 2009
    Posts:
    144
    Ok, it works with a simple capsule collider:
    357c16b3319429c2624b7377a8d9d0bc.jpg

    Odd... works for me with both 1st and 3rd person controllers (both from Standard Assets in 2018.3):
    4a59e4d8264b7d3747fcf3da006f409d.png

    All object dropped from 250, 100, 250 over a standard terrain.
     
  10. FragSalat

    FragSalat

    Joined:
    Mar 21, 2019
    Posts:
    2
    Funny. I've created a new project, with a new scene, saved it and did the same and now it works. o_O