Search Unity

Bug Unload texture asset

Discussion in 'Asset Bundles' started by Vladnee, Oct 28, 2022.

  1. Vladnee

    Vladnee

    Joined:
    Apr 28, 2017
    Posts:
    26
    How can I unload the textures?

    When I use Resources.UnloadAsset on the material's texture, it will unload the texture from memory, but the next time I create the object with the same material, the texture isn't loaded into the material and it will look black.

    Edit:
    I found a workaround that fixed this problem when I set loaded material to renderer using
    renderer.material = new Material(loadedMaterial) instead of
    renderer.material = loadedMaterial
     
    Last edited: Oct 29, 2022