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?


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.