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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Path creator's road mesh doesn't collide

Discussion in 'Physics' started by Arejas, Apr 28, 2020.

  1. Arejas

    Arejas

    Joined:
    Mar 28, 2020
    Posts:
    2
    Hi,

    I'm using Path creator (https://assetstore.unity.com/packages/tools/utilities/b-zier-path-creator-136082#reviews), it works perfect! It also creates a road mesh along the path, but I can't make this road mesh to collide with the car, the car simply falls down through the road. I tested the same car on terrain, with terrain it collides. Both the road mesh and the car have mesh colliders ( "convex" is checked). Though car's collider is not the component of the main car, but of it's child - body. Both road and car body also have rigid bodies, for them tried different collision detection settings (discrete, continuous...). I tried also box collider on the car, but there was no difference. Can't think of anything else should I do...

    Thanks in advance!
     
  2. alexeu

    alexeu

    Joined:
    Jan 24, 2016
    Posts:
    257
    Just an idea : Duplicate Road Mesh Holder and put the copy as child (let's call it RoadCollider).
    Remove the mesh renderer of RoadCollider you don't need it.
    Add a mesh collider to RoadCollider.

    and its done...



    And it works here also by adding directly a mesh collider to Road Mesh Holder... no need to add a copy... The collider is not Convex and the cube has a rigidbody.
     
    Last edited: Apr 29, 2020
    Energymillion and Torkilws like this.
  3. Arejas

    Arejas

    Joined:
    Mar 28, 2020
    Posts:
    2
    Thanks a lot! Yes, I tried on to make new path and road mesh holder, it works just fine, as you mentioned. I don't know what I've done with my old path/road as it has some triple structure when I switched to wireframe view, but certainly I have mixed something up with it :)
     

    Attached Files: