VRKeys icon indicating copy to clipboard operation
VRKeys copied to clipboard

Unity Asset does not work for Unity 2017

Open TheSeanLavery opened this issue 4 years ago • 7 comments

I think the update to 2019 broke something.

TheSeanLavery avatar Aug 01 '19 23:08 TheSeanLavery

The update relies on newer Unity APIs that were introduced in 2018, so projects will either have to stick with the previous version or upgrade Unity I'm afraid.

lux avatar Aug 02 '19 11:08 lux

We can't put in some conditional compile directives? I'm using the LTS version of 2018.4, and I can't use the package either. I LOVE the updates to XR devices in 2019, but I was hoping you could use conditional compile directives to maintain compatibility with the 2018.4 version, since we are unable to upgrade our major project at this time.

OptrixAU avatar Aug 06 '19 23:08 OptrixAU

My mistake on updating to the 2019 XR devices APIs, I didn't realize they changed so much between 2018 and 2019 but it looks like the tracking capabilities require 2019...

Does it work if you stick with the previous release? The only real change was the 2019 updates.

lux avatar Aug 07 '19 21:08 lux

2019 seems so new and untested. There are a lot of performance and UI bugs that might ruin project.

I'm staying away from 2019 until it can be proven more stable than 2017 and 2018 in a production environment.

It would be nice if the asset in the store had a 2017 version that worked.

TheSeanLavery avatar Aug 12 '19 20:08 TheSeanLavery

The performance of the Light-Weight Render Pipeline on VR in 2019 is very nice, and controller input is SO much better with the 2019 API. LWRP also appears to work around a BUNCH of problems you get on the Quest headset, like with post-processing effects and single-pass rendering on Android.

OptrixAU avatar Aug 12 '19 22:08 OptrixAU

I'll see about putting together a 2018 branch soon. I understand we can't all jump to the latest version right away.

lux avatar Aug 13 '19 14:08 lux

The major issues seem to be mostly about controller input - you might be able to use preprocessor directives to have a single branch that supports both.

For example, in Assets/VRKeys/Scripts/Controller.cs, you could substitute functions like the ones below...

private bool DeviceIsValid () {
#if UNITY_2019_0_OR_NEWER
      return GetDevice ().isValid;
#else
      return GetDevice().IsValid;
#endif
}

and

public bool OnGrip () {
			if (!DeviceIsValid ()) return false;
                        bool value;
#if UNITY_2019_0_OR_NEWER                       
                        GetDevice ().TryGetFeatureValue (CommonUsages.gripButton, out value);
#else
                         value = Input.GetButtonDown("grip");
#endif
                         return value;
		}


Note that this would mean you would need to define "Grip" as a button in your input manager.

OptrixAU avatar Aug 13 '19 22:08 OptrixAU