dabeschte / VRArmIK

Unity Inverse Kinematics solution for arms in VR
MIT License
158 stars 19 forks source link

Not working with the latest version of Unity XR #7

Open ataylor09 opened 3 years ago

ataylor09 commented 3 years ago

I can't seem to get the demo scene working with the latest Unity XR package (Unity 2019.4, XR plugin management version 3.2.16) I noticed that The method: UnityEngine.XR.InputTracking.GetLocalPosition(node) is obsolete. This may be the cause of the issue?

dabeschte commented 3 years ago

yes, this seems very likely. Unfortunately, I don't have a VR headset anymore and don't actively maintain this package anymore. But I would be more than happy to accept your pull request once you get it running. According to this, the API changed slightly, but should not be too difficult to work out

LMBooth commented 3 years ago

Looking in to this, it seems you can still use UnityEngine.XR.InputTracking.GetLocalPosition(node) and similar deprecated functions with the new version Unity XR and OpenXR plugin (this is in Unity 2020.2.2f1 to allow easy integration in to multiple VR devices). My work around (after following some of the OpenXR setup instructions made by VR with Andrew) was to remove any instances of LocalVrTrackingInput.cs - in the children of PoseManager - and add the new XR script TrackedPoseDriver with eye position and rotation bindings to the hmd object as well as your camera and XRRig, example in the following image: image

An ActionBasedController script needs to be added to each controller with relevant devicePosition and deviceRotation bindings, see following image for an example (You can add extra actions via this script too. You don't need to add a model or transform to the ActionBasedController script as it will just use whichever hand models you have specified in the avatar arms objects): image

Hopefully that makes sense for anyone stumbling across the same problem in the future.