InputActions.bindings and InputActions.controls both initialize as null for haptic [XR Controller] action handles in v1.4.1 of the ‘new’ Input system with v1.4.2 of the OpenXR plugin.
This causes all calls to OpenXRInput.SendHapticImpulse() to fail when OpenXRInput.GetActionHandle tries to evaluate the properties of inputAction.controls.
Should Haptics really be ‘registered’ with the InputActions system as an ‘Action’?
I have the same problem too. I create input action asset and create action binding with OpenXR standard path. however, action.controls.count always zero. i dont know how to create control for my action. Do i must to create control in Unity XRSDK?
Digging further into Unity’s codebase, I’ve determined that it’s the m_Bindings array of InputActionMap.cs that contains 3 entries that are null and uninitialized outside of having an ID. From what I can tell it’s a failure of the InputActions editor to correctly populate/remove an item from the map as I’ve verified each of the entries in each of my control schemes to be listed.
While I’m remiss to do it, I may have to delete the entire actions map and re-build it from scratch.
Edit: If you open your .InputActions file in Notepad++, and peruse the ‘bindings’ JSON array, you’ll see the offending entries plain as day. Delete them, then save the file and re-open the unity editor.
Hi @Reahreic ,
I’m sorry you’re running into problems with this. Are you able to post the full broken .InputActions file for us to investigate? Alternatively, you could file a bug through the editor (Help > Report a bug…) with the appropriate files/folders for our triage to reproduce it.
Sadly I can’t post the file as I’ve manually edited out the empty fields already. I do still have two more control schemes to add to the system so If it happens again I’ll post the whole thing. Uploading our projects as bug packages is problematic as they tend to contain ITAR data, which is well controlled. If I’m able to recreate it in a clean project I’ll submit one.
I’m thinking it was a result of having to update Unity versions which shifted me to 1.4.2 and may be a result of the change. I did notice that the Class File and Class Name fields were grayed after the update, but still contained the appropriate values. Oddly, only the haptics action tripped over the nulls, the rest of the actions across 2 schemes operated as expected.