Hey, i had a car i wanted the player to enter.
- on key down E (enter car)
- now we're in the "driving" state, on key down E (exit car)
..you can probably guess the problem, the key would be down when it entered the "driving" state, and so it exited the car immediately.
My quick fix solution: on key down E (go to "key up?" state), when in "key up?" state if key is up go to "driving state"
So only when the player releases E, do they get into the car. Is there a smarter way to do this, when it checks if the key is actually pressed, not just down?
Thanks guys, this is a really helpful community!