Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Resolved Unloading textures

Discussion in 'Editor & General Support' started by Guedez, Oct 23, 2023.

  1. Guedez

    Guedez

    Joined:
    Jun 1, 2012
    Posts:
    832
    upload_2023-10-23_18-50-28.png
    There are a ton of very large textures that are used to generate a Texture2DArray during runtime, then some of them are reused on other places and some of them are completely unused.
    Resources.UnloadUnusedAssets();
    did not deallocate them despite they having zero references. I called it the same frame I nulled the references, do I need to wait a couple frames? Or this method simply does not work?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,004
  3. Guedez

    Guedez

    Joined:
    Jun 1, 2012
    Posts:
    832
    Waiting a couple frames before calling
    Unload 
    did the trick