Search Unity

  1. Unity 2018.3 is now released.
    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. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    4
    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:
    990
    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:
    4
    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:
    990
    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:
    4
    worked! Thank you!!!