I am trying to set up a project to get input from the Motion Controllers’ A/B and X/Y buttons, following the documentation for HP Reverb G2 Controllers in Unity.
Right after adding the first part of code from the documentation to MotionControllerStateCache.cs, the console shows the following:
FileNotFoundException: Failed to load “vcruntime140_app.dll”. Please ensure that “Microsoft Visual C++ 2015-2019 Redistributable” is installed.
WinRT.ActivationFactory1[T]..ctor () (at <008cf01b9d2f4ab4b576cf1cad2f8766>:0) System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[ ] parameters) (at <9577ac7a62ef43179789031239ba8798>:0) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[ ] parameters) (at <9577ac7a62ef43179789031239ba8798>:0) System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) (at <9577ac7a62ef43179789031239ba8798>:0) System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) (at <9577ac7a62ef43179789031239ba8798>:0) System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) (at <9577ac7a62ef43179789031239ba8798>:0) System.Activator.CreateInstance[T] () (at <9577ac7a62ef43179789031239ba8798>:0) WinRT.WeakLazy
1+<>c[T].<.ctor>b__2_0 () (at <008cf01b9d2f4ab4b576cf1cad2f8766>:0)
WinRT.WeakLazy1[T].get_Value () (at <008cf01b9d2f4ab4b576cf1cad2f8766>:0) WinRT.ActivationFactory
1[T].ActivateInstance () (at <008cf01b9d2f4ab4b576cf1cad2f8766>:0)
Microsoft.MixedReality.Input.MotionControllerWatcher…ctor () (at <008cf01b9d2f4ab4b576cf1cad2f8766>:0)
MotionControllerStateCache.Start () (at Assets/Scripts/MixedRealityInput/MotionControllerStateCache.cs:54)
MotionControllerStateCache.cs, line 54 holds the following code:
_watcher = new MotionControllerWatcher();
Microsoft Visual C++ 2015-2019 Redistributable is installed.
Any help is highly appreciated.
UPDATE: Installed the latest Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 (both x84 and x64), still the same error.
Error first encountered in Unity 2019.4. Also tested with Unity 2020.3.