- Home /
How do i change controller from keyboard to mouse??
I'm doing Spaceship Shooter tutorial and I would like to change the way I control the spaceship from the keyboard (WASD or arrow keys) to moving player using the mouse. how I do that?? pls help
Answer by Zitoox · Oct 27, 2016 at 11:32 PM
First, you will need to completelly remove the inputs in your Project's settings. You can do that by going in: EDIT>PROJECT SETTINGS> INPUT
You can either delete all the inputs or leave all the keys as blank, you choose. An alternative would be to just remove the control by keyboard in your character controller. Then you just need to make a script that uses the mouse to control the player.
Thanks man. just figure it out. I changed PlayerController script.
Before:
float moveHorizontal = Input.GetAxis ("Horizontal"); float moveVertical = Input.GetAxis ("Vertical");
Now:
float moveHorizontal = Input.GetAxis ("$$anonymous$$ouse X"); float moveVertical = Input.GetAxis ("$$anonymous$$ouse Y");
Your answer
Follow this Question
Related Questions
Best Practice Multiple Control Methods 1 Answer
Keyboard / Mouse control for FPS 0 Answers
Bullet mouse control 2 Answers
OnGUI() and key pressing problems. 2 Answers
Making a torque-based sphere controller by simple mouse inputs 2 Answers