Hello everyone i want to make a Keyconfig script but im stuck. Right now i have it setup that every Aktion like move forward, move left, move right etc. has its own function for configuring it like this
public void Configforward () {
if(Input.GetButtonDown("Q")){
forward = "Q";
Configstufe = 0;
}
if(Input.GetButtonDown("W")){
forward = "W";
Configstufe = 0;
}
if(Input.GetButtonDown("E")){
forward = "E";
Configstufe = 0;
}
And so on for every key on the keyboard
}
But this gets me a like 2000letters long script. so how can i store the forward in another variable so i can say in my other script set varibale aktion to forward and then it sets forward to the key. I think its possible with a arraylist but i dont have much knowlege white arraylists. Can someone please help me? And sorry for my bad english.