- Home /
[SOLVED] Input.GetAxis("Horizontal") returns wrong value?
Disclaimer: Just downloaded Unity for the first time today
When I started Unity and tried the demo, the character kept running to the left, this seemed strange to me, so I investigated the code, and came to the conclusion that Input.GetAxis("Horisontal") and Input.GetAxis("Vertical") returned the wrong values (-1 and 1 when no keys were pressed) equipped with that suspicion I made this demo file:
using UnityEngine;
public class MoveMe : MonoBehaviour
{
void Update()
{
Debug.Log("X=" + Input.GetAxisRaw("Horizontal") + " Y=" + Input.GetAxisRaw("Vertical"))
}
}
and once I ran it It returned
X=-1 Y=1
When I didn't touch any keys... I have tried remapping the Input, just in case that it had something to do with my keyboard or something, but that didn't change anything...
Any help would be much appreciated, as I'd really like to get started on Unity3d development
Note: I'm using C#, and I have a pretty decent knowledge of it, so you don't have to dumb down your answers for me (but please do explain them)
Do you have any joysticks or gamepads plugged in? I strongly suspect that it's something to do with your local setup, because I'm not getting anything like that here.
I don't have any as far as I can tell, but now that you mention it, I did install a gamepad emulator some time ago, maybe there's something with that driver... I'll have a look...
Uninstalled the emulation (Vjoy if anyone have the same problem) and it now seems to work!! Thanks for re$$anonymous$$ding me of that :) Now off to learn Unity...
Your answer
Follow this Question
Related Questions
Joystick axes output wrong in 4.3.4 0 Answers
Input.GetAxisRaw returns -1 when it should return 0 1 Answer
Why does holding down any button cause ~20-30 FPS loss? 1 Answer
How to keep position on input.get axis even when it is pressed twice? 1 Answer
iPhoneKeyboard.Open cannot handle multiple entries. Is it a bug? 1 Answer