I making a top down space shooter similar to Astroids. I want to use my joystick's right analog stick to fire the players weapon similar to any game on PSN or XBLA of the same genre.
How would I acchomplish this in CSharp? Java is also fine if you don't know CSharp.
asked Apr 27 '10 at 10:59 PM
In the input manager you can define extra controls such as the x and y axis of a second joystick (default is accept data from all joysticks so you might want to change that). Assuming the right stick is read as a second joystick, you can use the input from the right stick to aim your weapon similar to walking.
Use the look at function to turn your character to face the direction of the joystick e.g.
transform.LookAt(transform.position + Vector3.( Input.GetAxis ("Horizontal"),0, Input.GetAxis ("Vertical"));