Hey guys^^
I wanted rebuild my 4 way, 2D shooting script, so that it shoots only in the direction where the last key is pressed.
This is what I have so far:
if (Input.GetKey ("down")) {
shotDirection = 1;
}if (Input.GetKey ("up")) {
shotDirection = 2;
}if (Input.GetKey ("left")) {
shotDirection = 3;
}if (Input.GetKey ("right")) {
shotDirection = 4;
}
But with this way, if more keys pressed it takes the last key from the order.
I expermented with Event.current.key only to see that Event works only in OnGUI xD
Sadly I have no idea how to solve this
Does anyone have some suggestions for dealing with this problem?
Thanks a lot guys