- Home /
OpenVR controller allocation is broken
Hi Unity users,
I appear to be having a problem with device management using 2 Vive controllers and a Vive tracker. Depending on the order in which they are turned on and off they are incorrectly allocated XRNodes.
If a Controller is turned on followed by a HardwareTracker, the tracker will be swapped in as the second (Left) controller. If a tracker is switched on on it's own, it will register fine as a tracker. However, if a controller is then turned on, the Tracker will be assigned one of the Hand nodes and the controller the other. Below are some demonstrations of this:
Tracker only
Then controller turned on.
There are numerous permutations of this, essentially if both controllers are turned on first then the tracker, it works fine. However, if one is then switched off all number of reallocations can happen with little apparent logic. If unity is launched with all 3 devices on then allocation is seemingly random.
This switch occurs upon successful tracking, after powering on. It seems to resemble behaviour from an older Steam Controller Manager script that was inherently broken when additional controllers and trackers were added. Here is my code for debugging:
InputTracking.nodeAdded += NodeAdded;
private void NodeAdded(XRNodeState obj)
{
ulong id = obj.uniqueID;
Debug.Log("Object ID: " + id + ", connected as " + obj.nodeType);
}
// Debugging Joystick allocations
private void JoystickNames()
{
string[] joysticks = Input.GetJoystickNames();
int i = 0;
foreach (string s in joysticks)
{
Debug.Log("Joystick at " + i + ": " + s);
i++;
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612180119im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Steam VR Display Hurt HUD 0 Answers
How do I manually offset a VR players head? 1 Answer
Steam VR always asks for BINDING in starting the game 0 Answers
Forge Networking With Steam 0 Answers
Apply Local Rotations to VR Camera 0 Answers