issue with key input in if statement

having issues detecting when the i key is pressed it runs the code when i dont press it?
11 Replies
Jamster3388
Jamster33882y ago
forgive my stupidity if its really obvious but i cant figure it out
Jamster3388
Jamster33882y ago
Jamster3388
Jamster33882y ago
i think its because its not in the main methods
TheBoxyBear
TheBoxyBear2y ago
You have a semicolon after the if
Jamster3388
Jamster33882y ago
i swear there was a error there
TheBoxyBear
TheBoxyBear2y ago
It becomes an empty if block and the line after is outside You actually have a warning on that semicolon
Jamster3388
Jamster33882y ago
yeah i realised but now it doesnt run the code in the if block at all now
deem
deem2y ago
make sure it's in the if statement
Jamster3388
Jamster33882y ago
do i need the curly brackets? is it cause it cant be called anywhere? ah wait alright it needs to be in every single method but that fucks with certain methods and creates a kinda blackscreen
Jamster3388
Jamster33882y ago
Jamster3388
Jamster33882y ago
fixed it realised what created the issue thanks for the help with the other things it would have taken me a second to realise those