- Home /
How do I access a gamepad's joystick position?
How do I return/access this? Similar to how you'd do it for an Iphone's GUI joystick?
Many thanks in advance! =D
Comment
This what you're looking for?
// Deter$$anonymous$$e the angle of the thumbstick
xAxis = Input.GetAxis("Horizontal");
yAxis = Input.GetAxis("Vertical");
// Calculate the angle of the thumbstick
var angle : float = $$anonymous$$athf.Atan2(xAxis, yAxis) * $$anonymous$$athf.Rad2Deg;
Answer by JOHNMCLAY · Jul 03, 2012 at 04:48 AM
Thanks for the reply Commodore!
Turns out I just needed the "Input.GetAxis("Horizontal")"...etc for the custom Joystick input that I'd created!
Your answer
![](https://koobas.hobune.stream/wayback/20220613073614im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Use Gamepad right analog stick instead of mouse to control crosshair movement 3 Answers
Dragging prefab into hierarchy reset position now? 0 Answers
Change transform.position.y in a loop 1 Answer
how can i target a nother cube from a script 1 Answer
How do you get the vector3 of one object and assign that vector3 to another object? 1 Answer