So I have this problem where I can manually put a color on something and it’s perfect, but when I change it’s color with a script, it becomes darker… as you can see in the screenshots. I’m pretty sure it has something to do with lighting but I’ve tried a lot of things and it’s just not working.
private void OnTriggerEnter2D(Collider2D col1)
{
if (col1.gameObject.name == "prplPatt")
{
col1.gameObject.transform.localScale += new Vector3(0.045f, 0.065f, 0f);
col1.gameObject.GetComponent<Renderer>().material.color = new Color32(161, 0, 209, 255);
coli = true;
}
}
private void OnTriggerExit2D(Collider2D col)
{
if(col.gameObject.name == "prplPatt")
{
col.gameObject.transform.localScale += new Vector3(-0.045f, -0.065f, 0f);
col.gameObject.GetComponent<Renderer>().material.color = new Color32(115, 0, 149, 255);
coli = false;
}
}