Author Topic: DestroyImmediate Error  (Read 6033 times)

ranilian

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 24
    • View Profile
    • Industry Corporation
DestroyImmediate Error
« on: July 19, 2012, 05:04:40 PM »
Hey Aren,

I keep getting the following:


Destroying object immediately is not permitted during physics trigger and contact callbacks. You must use Destroy instead.
Scene is being destroyed while there are hidden renderers that are using it. This is likely an editor script creating objects with hideFlags and leaving them enabled.

I follow the stack and it seems to be calling NGUITools.DestroyImmediate when I call Destroy on the gameobject that has a uilabel as a child.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: DestroyImmediate Error
« Reply #1 on: July 19, 2012, 05:06:03 PM »
Where are you getting it? Sounds like you're trying to destroy some object from within a physics-driven callback.

ranilian

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 24
    • View Profile
    • Industry Corporation
Re: DestroyImmediate Error
« Reply #2 on: July 19, 2012, 05:09:45 PM »
Yeah I was destroying it during collision however, I found out that the widget itself had a UIPanel and that caused this error. Now I have one UIPanel as a parent of the gameobject which fixed this issue.

winresh24

  • Guest
Re: DestroyImmediate Error
« Reply #3 on: October 01, 2012, 08:57:50 AM »
How did you solved plsss explain it to me...plllssssssssssssssss....Thanks hope to your reply :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: DestroyImmediate Error
« Reply #4 on: October 01, 2012, 04:50:26 PM »
He already did. He said he had a panel on his widget, which is wrong. Panel should be on a parent of the widget, not on the same game object.