I’m developing for the Oculus Go, which only has one controller, and I’d like to disable the unused controller. I’m attempting to make this game forwards-compatible - so that two controller users can still play. And, of course, there’s the fact that not all players have the use of both arms.
Plus, it’s just annoying having that raycast from the unused controller blasting!
My plan is to do something like this:
void ControlCheck()
{
if (BOOL TRUE IF THIS CONTROLLER IS IN USE)
{
Debug.Log(gameObject.name + " is in use");
}
else
{
gameObject.SetActive(false);
Debug.Log(gameObject.name + " is NOT not in use");
}
}
Use the input system to get all input devices and then check their characteristics to see if the device is a HMD, left or right associated controller and depending on that info disable your gameobjects.
You could get all devices at once with
InputDevices.GetDevices(m_InputDevices);
and then loop over them as an improvement, but I guess as you only run the code once it wont make any difference