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

Disable all colliders of an gameobject

Discussion in 'Animation' started by Verdemis, Mar 11, 2014.

  1. Verdemis

    Verdemis

    Joined:
    Apr 27, 2013
    Posts:
    92
    Hello Unity Community,

    at the moment i'm working on a prototype for a 2D plattformer. I'm fairly new to unity, but it's a loot of fun and the work is going really well. Now i'm facing a problem where i can't find a solution and i'm hoping someone her can help me :)

    I have a animated sprite with three colliders, two circle and one box. This sprite is an NPC and wenn the NPC dies i want to remove or disable the colliders. I dont want to remove the game object, because the corpse should not vanish.

    With the end of the dying animation i remove the colliders within the animator. This works for only one circle collider and the box collider. But i can't remove the 2nd circle collider. When i choose the enable option in the Animator to disable it at the end of the animation, this option is'nt available anymore at the 2nd collider. I tryed to set the 2nd circle collider as a trigger, so the player can pass the collider, but this doesn't work either.

    I know i could remove the whole gameobject and replace it with a sprite that displayes the corps, but i would like to know how i can handle this collider problem.

    Best,
    Verdemis
     
    Last edited: Mar 11, 2014