Listening keypresses out of Update?
I have an Event Manager class with 1 function per event. Each event has two options triggered by a keypress. The event is being called from the Game Control class and I want to be able to trigger these choices by using keypress. However...since this is out of an Update function, the keypress do nothing.
Any hints or examples from someone who made something similar?
First question on the forum, thanks in advance!
Cheers,
Answer by Sgt_Spike · May 28, 2018 at 10:50 AM
Hmm, I'm not sure I'm understanding your scenario here, why would you not want your GetKeyDown methods in the Update() function? Update is called every frame, so using any other function or InvokeRepeating will most likely not work. I might be able to understand your situation a bit more if you give a code sample of your EventManager class and your GameControl class.
Your answer
Follow this Question
Related Questions
Unity - Lines after yield not getting executed 0 Answers
Invoke method is not called 2 Answers
How to pass data between 2 yielding blocks of code? 0 Answers