Reply To: Isn’t there a more elegant way of detecting player input other than tons of if-Statements?

Forum Archive Isn’t there a more elegant way of detecting player input other than tons of if-Statements? Reply To: Isn’t there a more elegant way of detecting player input other than tons of if-Statements?

#27545
Jonathan Gonzalez
Participant

    As far as I’m aware there is no better or even different way of checking for input. I don’t know if this will be changed in the future, but it’s not a performance drain by any means. Yes you should use Update only as needed and input is one of those things. If you’re using GetComponent or calculating some complex math in the Update method then that’s where you’d start to see performance issues. 

    You could always use something like a Coroutine that checks less often, maybe once every .05 seconds, but then you may lose some of the precision. So there’s always a trade up. The current way is still used because it’s simple and performant.