Unity Delete Gameobject After Time

12/4/2017by

Oct 13, 2013 UnityEngine.Object.Destroy not deleting GameObject. Not remove anything in the editor at play time. Unity is destroying the parent game Object and all. In this article you will find several types of timers in Unity explained. Area of any GameObject tagged. Can call methods after a period a time.

So I am back to this thread again. My code does a LoadLevelAdditive - all GameObject's for the level are parented under a placeholder game object to make to easy to nuke them later. While I see Unity is destroying the parent game Object and all the children (as viewed in the editor). I can see through instruments on the actual device that the 10MB of memory used by my level is not being freed up and every time I reload the level another 10MB is consumed. So first of all am I handling this correctly? I am probably being a little lazy here trying to flush the toilet vs picking out the poo but i really would like to reset all elements of the level to a known state easily if possible.

IByte EDIT: reread the thread, will try destroy immediate again but I don't think that should be necessary? Tex Willer Pdf Gratis - Free Software And Shareware. RE-EDIT: DestroyImmediate did not seem to make any difference.

Unity Delete Gameobject After TimeCreate Empty Gameobject Unity

Hi Andeee, for a start I decided to rule out any external code being called via plugins and it turns out my own plugin is the main culprit. Having said that I would still appreciate your interpretation of this allocation memory graph I to took with all external 'Obj-C' code disabled.

What could be in the first big memory allocation when the level is loaded the first time but not on subsequent loadLevelAdditive calls? If code in my level references a class like iTween for example - would that class memory be released when the level is unloaded or would that stick around? Thanks iByte.

Comments are closed.