I am trying to change the color on a sprite/game object so the player has a option to change colors, however when I do set it, the object or part of it disappears, instead of changing color, example below:
public GameObject Female_char;
public SpriteRenderer f_hair;
public int P_Gender_Index = 0;
public int P_Hair_Index = 0;
if (P_Gender_Index == 0)
{
if (P_Hair_Index == 0)
{
f_hair.color = Black;
}
if (P_Hair_Index == 1)
{
f_hair.color = Blue;
}
if (P_Hair_Index == 2)
{
f_hair.color = Red;
}
if (P_Hair_Index == 3)
{
f_hair.color = Green;
}
}
I do have a method when buttons are pressed, it changes the P_Hair_Index whether P_Hair_Index++ or P_Hair_Index–.
not sure if there is any additional info needed, but let me know.
so tried to set it to black, and the object or the part of the hair of the character just disappears… nothing changes on the properties, like nothing changes such as it disabled/false or hides it, it doesnt change the location of it, it doesnt change the sorting order/layer to anything, i also check the order number and remains the same
also, changing color like this will probably not give you the results you want, it only works correctly if the sprite you are changing color is grayscale and even then the range of colors you can get is quite limited
gotya thank you for that, i do see a difference, like blue, its really dark, but what i tried to use for the public Color Tan etc. is use the color wheel (see attached for image), i know its all black, but when i change it to Tan or blue, I thought with that public Color Tan would assign the color like so: