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. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  5. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

UnityWebRequestTexture returns magenta in build

Discussion in '2018.3 Beta' started by oLDo, Dec 12, 2018.

  1. oLDo

    oLDo

    Joined:
    Mar 14, 2017
    Posts:
    55
    Hi.

    I'm using unity www functions to load image files from harddrive as texture2D. But somehow is not working in release build. In Editor works fine, image is loaded to texture. But in build I see online magenta color instead of image. There is no errors in log file.

    Unity version 2018.3.0b6
    Script Runtime Version: .NET 4.x Equivalent
    Scripting Backend: Mono
    Api Compatibility Level: .NET 4.x

    This is what I have in coroutine
    Code (CSharp):
    1. var req = UnityEngine.Networking.UnityWebRequestTexture.GetTexture(file);
    2.         yield return req.SendWebRequest();
    3.         onDone(UnityEngine.Networking.DownloadHandlerTexture.GetContent(req));
    4.  
    onDone is property
    Code (CSharp):
    1. Action<Texture2D> onDone;
    Can somebody help me? What can be possible wrong?
     
  2. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    556
    magenta = broken shader
     
    LeonhardP likes this.
  3. oLDo

    oLDo

    Joined:
    Mar 14, 2017
    Posts:
    55
    Man, you are Boss. It was because of it, I needed to add shader to "always included shaders" in Graphics settings.