Hi all. I’m getting a recurring issue with mouse and touchscreen input not being registered in windows builds with Unity 2019.1.8f1. Even this simple script wont work, logging spacebar presses but not mouse:
using UnityEngine;
public class TestScript : MonoBehaviour
{
void Update()
{
if(Input.GetKeyDown(KeyCode.Space))
{
Debug.LogError("space down!");
}
if(Input.GetMouseButtonDown(0))
{
Debug.LogError("mouse button down!");
}
}
}
Running this in a blank project works fine, but when put on a gameobject in our main project it doesn’t work. Unfortunately it’s an enterprise project and I can’t link specific code, but will answer any questions. This script is on a standalone gameobject however, so I can’t see why it would have problems.
I have run this on multiple machines with a variety of mice. None of the Input methods register the mouse.
We are rendering up to 6 cameras at once, so I wondered if it was related to this:
However when disabling all but the main camera before building the problem persists.
If anyone has a clue why out mice would not be responsive in builds, but fine in the editor please help me out!