- Home /
How to code input.
Hi, i'm new to scripting and i'm still trying to learn to code efficiently. so far i have a small list of possible inputs inside my character script's 'update' function. one for the flashlight, kicking, interacting, picking up objects. its a small list but as my game grows and the amount of keys the player has access to increases the game will just constantly be checking every update to see if they are pressing the 20-30 some keys they can press. is there a better way to do this? or should i just keep them all lined up in the 'update'?
Unless you have very complex math algorithms at every key press, this will not be an issue, like @clunk47 said.
@$$anonymous$$iraSensei - Thx for stating it more clearly than I did, +1 :)
Answer by clunk47 · Sep 24, 2013 at 04:27 AM
This won't make any performance problems arise unless you have a really crappy computer lol. GetKeyDown only returns true if the user presses the key. Otherwise, nothing is going on that would affect performance.
Your answer
Follow this Question
Related Questions
Eliminating input loss 1 Answer
Detecting and saving keyboard presses without using more than 20 if statements. 0 Answers
Input.GetMouseButtonDown(0) running through my if statments too quickly 1 Answer
Input and applying physics, Update or FixedUpdate? 3 Answers
input not working on high framerate 0 Answers