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

Question Check if triangle collides with any object in certain LayerMask

Discussion in 'Physics' started by Neuron_Unity, Sep 2, 2020.

  1. Neuron_Unity

    Neuron_Unity

    Joined:
    Aug 22, 2020
    Posts:
    2
    I am creating a custom navigation mesh and in order to see which triangles in my mesh are traversable I need a way to check if anything on a certain LayerMask in my scene collides with my triangle.

    I have already thought about using consecutive RayCasts to "fill in" my triangle, but this seems needlessly complex and computationally slow. Is there a built in function in Unity to achieve this?

    I have also asked this question on Stackoverflow. If you have a good answer, consider posting it there as well.