- Home /
GetKeyDown is fired more than once in Update()
Hi,
I already read in several threads that GetKeyDown is fired more than once if it is called in OnGUI. In my application it is called in Update() and it is called twice. I already assured that this class is only created once (by incrementing a static variable in the constructor).
Any ideas what else could cause this bug?
Thanks!
Kathrin
Unless you are talking about Start(), you should not have constructor if the class is derived from $$anonymous$$onobehaviour (and you wouldn't be calling Update() if it wasn't). Just to be sure, type your class name into the search box at the top of the Hierarchy frame. Posting your code might help someone spot the problem.
Answer by Kathrin-Jennifer · May 17, 2013 at 06:07 PM
Thanks for the answer! The class doesn't derive from MonoBehaviour and I already searched through the hierarchy.
And I also found the bug... The base class has already initialized our input system and the derived class mistakenly did it again. That was the reason for the bug...