need help with my script! c#

hi, i am making a game. and i use c#. this is my very first game i make. and been a week just started learning how to code. at first i was happy with the performance of the game. its a face phase.
so if the player’s attack would delay then im in trouble.

so at first, i set up inputgetkey. its to kill the enemy on a certain direction. so far the script is going well.

so until i wanted to try it on android. my goal is to set up code for touch then test the game at the same time without losing the inputgetkey i setup. just in case my tablet would go low bat.

so my idea, is to set up a boolean for example. attackleft, so if i press “a” it will set attack left true. also if i swipe to left.

after setting up the boolean. i wanted to try out the keyboard button first[ihavent place the codes for touch yet). maybe there would be delay on the player’s attack.

and when i test it theres now a delay. so this would be a problem for the game. its face phase. and the player will not be ablle to keep up now.

so i need your advice. on what i should do. i would like to have the keyboard and the touch be able to set the booleans true and execute without delay.

so i attach here the code. but i have more codes for triggers and stuff. in case if you need more pls let me know.

also i apologize in advance about the arrangement of my nooby codes :slight_smile:

thank you

3079318–231776–move test.cs (7.49 KB)

Please put your code in your post using code tags.

As general advice, instead of trying to detect swipes, it will be easier as a beginner to just use a Button. Go through the UI tutorials if you don’t know how to use buttons yet.