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. Dismiss Notice

Create a hole in a mesh collider at runtime

Discussion in 'Scripting' started by Jymmy097, Oct 14, 2014.

  1. Jymmy097

    Jymmy097

    Joined:
    Jul 7, 2014
    Posts:
    67
    Hi everybody,

    I would like to know if it is possible to create holes in a collider at runtime. Something like boolean operation between two colliders. Thanks.

    Jymmy097
     
  2. Deecann

    Deecann

    Joined:
    Mar 17, 2010
    Posts:
    93
    Maybe this way: when you are in proper position disable collider or make it triggered.
     
  3. Jymmy097

    Jymmy097

    Joined:
    Jul 7, 2014
    Posts:
    67
    Thanks for your reply, but I was wondering if there is some ways to physically modify the collider, not fake the effect...

    Thanks!

    Jymmy097
     
  4. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,039
    There are no boolean operations for colliders. You could update a mesh collider, but it's pretty slow and you wouldn't want to do it very often. And you'd still have to figure out exactly what changes you wanted to make to the collider.

    It'd be better to have 2 different colliders prepared and simple enable and disable them accordingly.