I’ve been looking through the fairly simply Unity Roll a Ball example project, and I was wondering if it included an example of joystick control. Joystick setup is referenced in the ‘Controller’ script, but I’m not sure if it is implemented in the project. If not, can someone suggest a basic joystick tutorial or example project? Thanks
The joystick input instead of iPhone accelerometer input in the ‘Controller’ script does not refer to another script or anything. It simply says if you do not wish to use the accelerometer control use
Which basically means you can control the game using the arrow keys or wasd keys. Unity actually maps these “Horizontal” and “Vertical” to an array of user input devices. So that you don’t have to change anything if you want to use an actual physical Joystick instead of the keyboard.
You can see this if you go to Edit->Project Settings->Input. For instance you can change the “Horizontal” axis to be trigger from keys ‘zx’ instead of ‘ad’ keys, just in here and without touching the code it still would work.