opening colored doors with the respective color keys

Hello, I have a little of a problem, I don’t know how to approach this but in our game, we have different doors with different colors. How can we make an HUE recognition to open the doors with their respective colored keys?

Depends how many doors, but it might be easier to give the door and the key a name and check for that, or give them a string property with the color.

lets say if we have 5 doors. (red, blue, green, yellow and orange)

Yeah, for five doors, I would just make a property for the key and the door.

string objColor = "red";


if(key.objColor == this.objColor){
//open door
}