Search Unity

Getting the areas of multiple intersecting Trigger Colliders.

Discussion in 'Physics' started by Czar-Man, Sep 26, 2018.

  1. Czar-Man

    Czar-Man

    Joined:
    May 10, 2013
    Posts:
    20
    I'm working on a project about mixing colored lights together. To do that, I'm using mesh colliders as triggers. I've been trying to figure out a way to get the area or group of points where the colliders intersect so I could possibly use them as an object to create interesting events such as changing their physics or using particle effects.

    What I basically want to do is:

    If Light1 is colliding with Light2,
    Get all points where they are colliding with each other
    Turn the group of points into a mesh collider trigger
    Give that mesh collider trigger a script for when something else enters it

    In other words, if you have a Venn diagram, I want to just get the part where both shapes are intersecting and turn that into a usable shape.
    So far, the closest answer I've found is the use of plane structs, but I'm not sure how to implement it using my limited coding skills. This is mostly for the purpose of rapid prototyping.

    Any help would be greatly appreciated.