Search Unity

[Legacy] Animation.AddClip major memory issue

Discussion in 'Animation' started by manutoo, Dec 24, 2014.

  1. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    524
    Hello,

    I just wanted to give a little warning : if you use Animation.AddClip() in your scripts, it'll duplicate the AnimationClip in the memory instead of sharing it like if you have added it to your gameObject within the Editor.
    A warning note in the documentation would have been very welcome.

    Fortunately, I had already planned & started to move to Mecanim, else it'd have probably lead to some serious big delay in my game release to handle advanced dynamic level load/unload, as it was doubling the memory requirement for my game & thus would have lead to break over the 4GB limit.

    Note: this problem has already been reported here http://forum.unity3d.com/threads/bug-unity-not-releasing-animationclips.129916/ , but it was not the main topic of that thread.
     
    theANMATOR2b likes this.