Why is Unity repeatedly giving me the same "XRStats::SetStatFloat failed" error?

Viewed 381

I'm developing a VR application in Unity using Unity XR. After programming for a while, my console showed the same error repeatedly:

XRStats::SetStatFloat failed. Stats queue full! Stats for this frame will be lost.

I read that you should remove the Test framework package but this was without success.

void Start()
{
    List<InputDevice> devices = new List<InputDevice>();
    InputDeviceCharacteristics rightControllerCharacteristics = InputDeviceCharacteristics.Right | InputDeviceCharacteristics.Controller;
    InputDevices.GetDevicesWithCharacteristics(rightControllerCharacteristics, devices);

    foreach (var item in devices)
    {
        Debug.Log(item.name + item.characteristics);
    }

    if(devices.Count > 0)
    {
        targetDevice = devices[0];
    }
}


void Update()
{
    targetDevice.TryGetFeatureValue(CommonUsages.primaryButton, out bool primartButtonValue);
    if (primartButtonValue)
    {
        Debug.Log("Primary trigger");
    }

    targetDevice.TryGetFeatureValue(CommonUsages.trigger, out float triggerValue);
}

I removed the script that is referenced above and still getting the same message. I've tried removing and installing all XR plugins but nothing works.

0 Answers
Related