I have a 3rd-person controller in my Unity scene, which I can only control with the WASD buttons. But since I plan to make a smartphone game, I wonder how I can change these controls t swipe up/down/right/left and (if possible) keep WASD for debugging.
Do this in character controller script's
First of all you have to detect the user input via touch(begin/moved/ended) methods and then you have to calculate the gesture it ended up in like swipe-left.
You can assign a bool to it like
SwipeL = true;
Now you have to add a condition in the methods where character movement is mapped with
Input.GetKey("A") etc and append your
bool with OR condition
if(Input.GetKey("A") || SwipeL)
//code for moving left
You need to do this for all key mappings.