Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Texture is not readable, the texture memory can not be accessed from scripts

Discussion in 'Scripting' started by DangerKiddy, Nov 17, 2020.

  1. DangerKiddy

    DangerKiddy

    Joined:
    Feb 29, 2020
    Posts:
    8
    Hello, I'm trying to upscale my texture using script:

    Code (CSharp):
    1. public Texture2D tex;
    2. ...
    3. tex.Resize(64, 64);
    But unity throws me error from the title. I've googled a lot about making the texture readable, but I found, that for some reason, my inspector don't have checkbox for making it readable:
    upload_2020-11-17_21-51-36.png

    So, how and where I can make texture readable?

    (I'm using Unity 2020.1.9f1)
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,723
    Expand the "Advanced" section and turn on "Read/Write enabled"
     
  3. Oneiros90

    Oneiros90

    Joined:
    Apr 29, 2014
    Posts:
    77
    My sprite has the Read/Write toggle enabled but I still get this error:

    Using alphaHitTestMinimumThreshold greater than 0 on Image whose sprite texture cannot be read. Texture 'sactx-1-4096x4096-Crunch-HiddenObjectAtlas-740480a6' is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the Texture Import Settings. Also make sure to disable sprite packing for this sprite.


    Any idea?
     
  4. Oneiros90

    Oneiros90

    Joined:
    Apr 29, 2014
    Posts:
    77
    Solved: make sure to enable the Read/Write toggle also on the atlas if you're using any
     
    PersianKiller likes this.