- Home /
How to set(raw) 'horizontal' input axis value in script
Im looking to set this value manually in script rather than waiting for a keypress(instead of Input.getaxis) to do some testing, but couldn't find any documentation to suggest if this was possible.
Has anyone ever tried this before?
thanks!
Answer by tanoshimi · Dec 03, 2013 at 07:39 AM
No you can't - Input.GetAxis is for reading input from a device - Unity can't set a joystick to a given direction, or make a keyboard key be pressed. Instead, you can simply assign the result of Input.GetAxis to a variable and override that instead.
Your answer
Follow this Question
Related Questions
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
How to get overall intensity for each Joystick Axis? 4 Answers
input resets after scene change,Held Down Input not responding after scene change. 0 Answers
How to convert Input.GetAxis to Accelerometer control? 2 Answers
Why does InputManager have multiple axes with the same name? 1 Answer