trying to compare 2 material colors

Please don’t post screenshots of source code; use code tags instead.

The documentation for Unity’s Color struct does not list an overload of operator==, but I’m pretty sure that C# doesn’t allow you to apply that operator to structs unless you’ve defined it, so…I guess they have one but didn’t bother to document it? A Google search turns up several other people who are getting unexpected results from it with no clear explanations, so who knows what it’s doing.

You might try writing your own comparison method that compares the R, G, B, and A properties individually (probably using Mathf.Approximately, because testing floats for exact equality is almost always a bad idea).

Olmi’s suggestion of using your own representation of gameplay category separate from the object’s actual color is also worth considering.