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.

Roadsystem - Mesh selfintersection

Discussion in 'Physics' started by Fragfire, Aug 13, 2016.

  1. Fragfire


    Apr 15, 2014
    Hey Guys :)

    I couldn't find an appropriate solution for my problem yet, so I want to ask for help directly.
    I'm currently working on a Roadsystem, where the user can freely (with some restrictions) design the road path. One of the restrictions is, that it is not allowed to cross a previous part of the road (crossings are created separately)

    So in the Image below you can see what I want to detect. I have one GameObject/Mesh for the Road and want to detect when the user is crossing a previous part of the road.

    My ideas were:
    a) use a separate collider per Roadpart (between 2 points). When I do have a collider for each part it would be easy to check if another part is crossed, but it would be very expensive too, especially when the road gets bigger.
    b) use multiple GOs/Submeshes which in the end would be expensive too.

    Is there any easy and performant solution ( :p ) for my problem?
    Reminder: I do NOT want to make an intersection there. I just want to not allow these crossings.

    Thanks for any help :)

    Attached Files: