- Home /
Using xbox controller with top down shooter
I have been trying to work out how the best way to do a top down tank game using an xbox controller.
I basically have 2 objects, the tank and the turret.
I want the tank to move in the direction used on the left analogue stick, with speed relative to how much the stick is moved to its full range.
I want the turret to rotate and fire when the right stick is used
I guess the simplest way to do this would be to transform.LookAt to achieve this? ie:
transform.LookAt(transform.position + Vector3.( Input.GetAxis ("Horizontal"),0, Input.GetAxis ("Vertical"));
Then I could use Vector3.addforce relative to the amount pushed on the left stick?
What do you think, or is there a simpler way to achieve this?
Your answer
Follow this Question
Related Questions
Connecting transform with Vector3 4 Answers
c# modify only one axis of a quaternion 2 Answers
How to make Y-Axis face away from a position? 2 Answers
How do I make gameObject.transform.rotation.z equal to a set float value? 2 Answers
How to change Vector3 if an objects rotation is a certain number? 1 Answer