Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug NEED HELP!!!! Addressable can't release RenderTexture properly.

Discussion in 'Addressables' started by marchall_box, Sep 14, 2022.

  1. marchall_box

    marchall_box

    Joined:
    Mar 28, 2013
    Posts:
    139
    Hi,

    I am getting below error on build.

    I am using
    Unity 2020.3.38f1
    Addressables 1.20.5


    I tried to put release manually just in case on Unload but its not working.

    Code (CSharp):
    1. RenderTexture.active = null;
    2.  
    3.         Camera[] comp = FindObjectsOfType<Camera>(true);
    4.         Debug.Log("camera count:" + comp.Length);
    5.         foreach (var c in comp)
    6.         {
    7.             if (!c) continue;
    8.  
    9.             Debug.Log($"Found camera '{c.name}' - resetting targetTexture");
    10.             if (c.targetTexture) c.targetTexture.Release();
    11.             c.targetTexture = null;
    12.             c.gameObject.SetActive(false);
    13.         }
     
    Last edited: Sep 14, 2022
  2. BogdanDude

    BogdanDude

    Joined:
    Jun 18, 2009
    Posts:
    89
    Hi!
    Have you managed to fix this? We are having a similar issue with URPs internal RenderTextures not being unloaded. Also using Addressables.
    Unity 2022.1.20f1
     
  3. dualcarbongames

    dualcarbongames

    Joined:
    Jan 14, 2022
    Posts:
    4