Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    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:
    559
    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.