Search Unity

Destroying objects should trigger the trigger exit event

Discussion in 'Wish List' started by Gaba, Sep 28, 2010.

  1. Gaba

    Gaba

    Joined:
    May 29, 2009
    Posts:
    41
    Please make it happen guys, i feel wrong every time i make an object have scale zero before destroying it.
     
  2. jimmio92

    jimmio92

    Joined:
    Nov 3, 2009
    Posts:
    31
    If the object is a rigidbody, you could remove the collider and let it fall out of view, and clean up a few seconds later...

    Destroy(go.collider);
    Destroy(go, 5.0f);

    You could scale, like you do.
    You could add a script called OnDestroy that calls a function in the rest of the game object called OnDestroy, and then you can set it up there. (I do believe game object messaging is "slow", however)
     
  3. Gaba

    Gaba

    Joined:
    May 29, 2009
    Posts:
    41
    I know there are a lot of workarounds for this, but they're just that, workarounds.

    I believe that triggering the event is intuitive