- Home /
Question by
VikasSharma · May 02, 2014 at 10:54 AM ·
inputaccelerometerinput.getaxis
How to convert Input.GetAxis to Accelerometer control?
var steerValue = Mathf.Clamp(Input.GetAxis("Horizontal"), -1, 1); var forwardValue = Mathf.Clamp(Input.GetAxis("Vertical"), 0, 1); var reverseValue = -1 * Mathf.Clamp(Input.GetAxis("Vertical"), -1, 0); var handbrakeValue = Mathf.Clamp(Input.GetAxis("Jump"), 0, 1);
above code working for car on key events I want to change this for Android accelerometer special for steerValue.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613144058im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to convert Input.GetAxis to Accelerometer control? 2 Answers
Detection of device fall 0 Answers
Unity3D cross-platform input wireless 1 Answer