Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Can't stop gameobject (imported obj file) from falling through the terrain

Discussion in 'Physics' started by conorgriff1986, Nov 4, 2018.

  1. conorgriff1986

    conorgriff1986

    Joined:
    Nov 4, 2018
    Posts:
    3
    Can someone please advise me how to stop my character falling through the terrain?

    The character is an imported obj file and once I add a rigidbody component, he falls right through the terrain. Bandicam_-_Unity.png
     
  2. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    559
    Two rigidbodys with concave(non-convex) mesh colliders cant interact.

    You dont put a mesh collider on the terrain, theres already a terrain collider there(a terrain collider is a special mesh collider optimized to work with the terrain system)

    Also, most of the time having a mesh collider on the player is just overkill.
     
    conorgriff1986 likes this.
  3. conorgriff1986

    conorgriff1986

    Joined:
    Nov 4, 2018
    Posts:
    3
    Thanks for the reply. But not sure what do I need to change to get it to work?

    Bear in mind that I'm a complete beginner so apologies for the basicness of my knowledge!
     
  4. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    559
    1) remove the mesh collider from the terrain
    2) either make the player collider a primitive(box, capsule, any thing that's not a mesh collider) or mark it as convex
    3) profit/come back to troubleshoot some more
     
    conorgriff1986 likes this.
  5. conorgriff1986

    conorgriff1986

    Joined:
    Nov 4, 2018
    Posts:
    3
    worked! Thank you!!!