How to get the game to recognize which material is assigned

A single boolean variable, “IsRed,” is all that’s necessary. The situation is clear-cut: the object is either red or it isn’t.

.