Hello Guest

Author Topic: Destroying object immediately is not permitted during physics trigger  (Read 5408 times)

EddyL

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
I got this message when flipping an animated sprite after a collision with a Box Collider
Quote
Destroying object immediately is not permitted during physics trigger

Quote
   
void OnCollisionEnter (Collision collision)
{
   if(collision.gameObject.tag=="GroundCollider")
   {
      anim.FlipX (); // Seems to be the source of the problem
   }
}

My Animated Sprite uses the "BoxTrimmed" Collider..

Anything I am missing here??
Sorry, and thanks!!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Hi,

This should be fixed in 1.75 final. The reason its doing that is in the editor, the collider is recreated every time it is modified to avoid some issues. In game however, the collider will only be resized.

The patch in 1.75 basically makes it run the "game" path when the editor is in Play mode.

EddyL

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
So I should just wait for the update then, thanks!!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
1.75 final is already out - the issue should've been resolved in there.