Search Unity

Material does not have a _MainTex texture property

Discussion in 'Addressables' started by HedgehogNSK, May 12, 2020.

Thread Status:
Not open for further replies.
  1. HedgehogNSK

    HedgehogNSK

    Joined:
    Jun 3, 2017
    Posts:
    24
    Unity 2020.1.0b8, Addressables 1.8.3, Target platform iOS.

    I'm loading prefabs via Addressables which contains Sprite Renderer component. "Sprites-Default" material set In appropriate field by default. I didn't have to change it.

    When I start game in editor using play mode "Use Asset Database" in addressable groups everything is fine.
    But when I start game using play mode called "Using Exsisting Build" sprite material doesn't display correctly and I see warning message in the inspector "Material does not have a _MainTex texture property".

    upload_2020-5-12_17-41-30.png

    How to solve this problem?
    Thx. :)

    ___
    Update. I add my own shader to the project which I created from the context menu and the story repeats. When I'm loading addressables from the server the same warning appearce in the inspector and the sprite looks purple again.
     
    Last edited: May 12, 2020
  2. HedgehogNSK

    HedgehogNSK

    Joined:
    Jun 3, 2017
    Posts:
    24
    For some reason when I'm loading my prefab with SpriteRenderer, material/shader doesn't load correctly ¯\_(ツ)_/¯
    So, I made local structure that stores material, and after loading addressable from server I'm pushing material from structure into object that were instantiated by prefab.

    If someone knows how to avoid this kind of manipulations I would be appreciated
     
  3. fire1991man

    fire1991man

    Joined:
    May 31, 2013
    Posts:
    18
    Did you fixed it ?
     
  4. fire1991man

    fire1991man

    Joined:
    May 31, 2013
    Posts:
    18
    @DavidUnity3d, i have same problem with this post, can you help me to fix it? thanks you
     
  5. daneric

    daneric

    Joined:
    Oct 10, 2015
    Posts:
    4
    Same issue!
     
Thread Status:
Not open for further replies.