I’m having trouble trying to change my sprite color in Start function.
public var colorArray : Color32[]; //Store all the colors
if(itemTag == "ReverseItem"){ //Item setup
var spriteRenderer : SpriteRenderer = this.gameObject.GetComponent(SpriteRenderer);
var randomColor = Random.Range(0,4);
spriteRenderer.color = colorArray[randomColor];
gameObject.tag = tagArray[randomColor];
}
}
**If I Debug it, it shows the correct sprite renderer. I’ve tried to change the color and the sprite variables, but none worked on this situation. Any help is appreciated! Thanks. **