Search Unity

One Texture Not Applying Correctly

Discussion in 'Scripting' started by renman3000, Apr 15, 2021.

  1. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    Hi there,
    Is there any reason why my application to alter a SkinnedMeshRenderer.materials[n].mainTexture = texture, would function properly on all Texture[] textures, but one textures[n]?

    I have gone over all import settings, they are identical, but for some reason, that I cant see why, a particular texture is not applying itself, at all, when all others do.


    Thoughts?

    Code (csharp):
    1.  
    2.     void createLegs(int rdm)
    3.     {
    4.  
    5.         //from body
    6.         Texture texture = CharMng.ins.soCharLegs.txArray[rdm];
    7.         smr_legs.materials[1].mainTexture = texture;
    8.         smr_legs.sharedMesh = CharMng.ins.soCharLegs.mhArray[rdm];
    9.  
    10.     }
    11.  
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,726
    Is it really the Texture that is acting different or is it the Shader for that Material?
     
    PraetorBlue likes this.