Now on a Testplay, Unity gives me the following Error: [spoiler]
Destroying GameObjects immediately is not permitted during physics trigger/contact, animation event callbacks or OnValidate.You must use Destroy instead.
The problem, as you can see at the Lines, is: I don´t destroy any object. I instantiated and Destroyed the Object, before i changed to SetActive - yes.. But i Changed it, saved it several times now.. But NGUI still thinks i´m destroying the Objects ._.
What´s wrong here?
Title: Re: "Destroying GameObjects immediately is not permitted" - But i don´t destroy!
Post by: pretender on December 25, 2014, 12:19:42 PM
Don't destroy/disable objects in OnTriggerEnter/OnCollisionEnter, make a coroutine to destroy/disable them instead...I believe simple method will work too.
Title: Re: "Destroying GameObjects immediately is not permitted" - But i don´t destroy!
Post by: Chaosgod_Espér on December 25, 2014, 12:21:52 PM
As said - i DON´T Destroy.. i simply change SetActive
Title: Re: "Destroying GameObjects immediately is not permitted" - But i don´t destroy!
Post by: Nicki on December 26, 2014, 04:49:59 PM
SetActive on panels makes the panel destroy the draw call. You still need to delay it until outside the physics call.
Title: Re: "Destroying GameObjects immediately is not permitted" - But i don´t destroy!
Post by: Disastercake on December 27, 2014, 02:25:17 AM
Does NGUITools.SetActive have much added functionality now that Unity automatically disables objects under the parent?
It might be cool for NGUITools.SetActive to get some added functionality by doing this sort of IEnumerator yield for you, maybe by passing in an extra bool value to clarify you want it to wait a frame.
Title: Re: "Destroying GameObjects immediately is not permitted" - But i don´t destroy!
Post by: ArenMook on December 27, 2014, 09:28:32 AM
NGUITools.SetActive is there because it was added long before Unity 4, so it's there for legacy purposes more than anything else.