Only the up/left arrow keys will not work… It does, however, work with w/a keys and all other combinations of arrow keys? What is going on…?
if ( Input.GetAxisRaw ( "Horizontal" ) != 0 & Input.GetAxisRaw ("Vertical") != 0 & Input.GetKeyDown ("space") )
{
print("t");
}
This is the code I used.
Thanks!
A single & is the bitwise AND operator - from your code, I suppose you actually want the logical AND (&&):
if (Input.GetAxisRaw("Horizontal") != 0 && Input.GetAxisRaw("Vertical") != 0 && Input.GetKeyDown ("space")){
print("t");
}
This code will print “t” when both axes are non-zero and the space bar is pressed - in other words, when pressing A or D and W or S and Space.
NOTE: Regular PC keyboards can report any two keys pressed at the same time, but 3 or more keys may not be correctly detected.