Input System NotSupportedException / Control count per binding cannot exceed byte.MaxValue=255

In my project, usually after I’ve been working for a bit, every time I enter play mode, the console floods with exceptions about not supporting haptics or something. The project was modified from the VR sample project so my XRI Default Input Actions.asset file originally came from that.

Up until this starts happening, everything works fine (haptic pulses included), but once this starts, the haptics seem to stop working. Once I restart the editor, everything is once again back to normal.

I just updated to the latest version of the Input System package (1.11.2) hoping that it would resolve this for me, but it continues.

It’s pretty annoying though. Sometimes I’ll go hours without it happening and other times, it happens faster. Any ideas what could cause a bug like this or a solution?

Perhaps you’re doing binding in Update() or some other method that gets called more than once?

Or perhaps you’re neglecting to unbind?

Either way… Sounds like you wrote a bug… and that means… time to start debugging!

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

Nope, I don’t think so.

It’s always about the Haptic Device. I never wrote any code dealing with that particular Input Action Reference. I’m just using the unmodified Haptic Impulse Player script that came with the VR sample project.

HapticImpulsePlayer.cs (5.9 KB)

It seems like there could be a memory leak bug in the Unity Editor that is causing an excessive number of controls to be resolved to the Haptic Device action in the XRI Default Input Actions asset. If you are using OpenXR, you can replace the Any binding (*) in those actions in the XRI Left and XRI Right action maps with <XRController>{LeftHand}/{Haptic} and <XRController>{RightHand}/{Haptic} which should resolve the issue.

Thank you, @chris-massie. i’m actually using the Oculus plugin. do you think that might still work?

@chris-massie can’t find anything equivalent to that in the binding options using the oculus plugin. any other way i might be able to prevent it?

The {Haptic} control will only work on OpenXR, so it won’t work for you if you are using the Oculus plug-in provider unfortunately.

You can report a bug and tag the Input System (com.unity.inputsystem) package, and I’ll also bring it up with that team.

As a workaround until the bug is fixed, you can replace the binding with <XRController>{LeftHand}/{DevicePosition} and <XRController>{RightHand}/{DevicePosition} since those should both resolve to some control on the device. The value of the control isn’t actually used in the code, it just identifies the active XR Controller device for the haptics component to send the impulse event to.

Thanks! I made those changes and hopefully I won’t be seeing any of those errors pop up in the future :slight_smile: