Hi, new to for statements here. I’d like to use a for statement instead of tonnes of if statements which include arrays. This is one statement that I use.
if(Input.GetKeyDown(keys[0]))
{
light.color = colour[0];
}
I’m using 2 array variables, one for keys ([0] is q right now). So when Q is pressed in-game, it changes the point light colour to the colour thats set at [0]. But for say, 25 keys ([24]), it’ll be if statement after if statement, which isn’t very neat. I feel that it can be shortened and I’d like to learn how.
Thank you, hope it’s understandable to read.