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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    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.