We are trying to debug an issue my son has on my laptop with his Unity game.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Keyboard : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
Debug.Log(Input.GetAxis("Horizontal") + "\t" + Input.GetAxis("Vertical"));
}
}
I would expect the debug to show “0 0” when I’m not pressing any arrow or WSAD keys on my keyboard.
But in reality it outputs “-1 1” and when I press the arrow keys they switch to -1/1 but never to 0.
I found several questions about this but as far as I could see those questions involved a joystick or gamecontroller which was not correctly calibrated. But I’m having these issues with my laptop keyboard.
Does anyone have a suggestion on what could be causing this?
I think I fixed it by changing the dead value from 0.0001 to 0.1
I would have programmed it using the keycodes like you showed in your examples.
I’ll try to educate him He is 13 and this is his first real experience with C# after a little Python.