Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kavery on August 26, 2020, 11:59:10 AM

Title: XR Settings - Get VR device?
Post by: kavery on August 26, 2020, 11:59:10 AM
I need to be able to detect if a player has VR equiptment. Any type. Getting the XR setting - device type - (or no device) would make sense but I don't see it anywhere? There used to be a VR device type but it's depreciated.

Any help would be great.
Title: Re: XR Settings - Get VR device?
Post by: LordHorusNL on August 26, 2020, 04:07:20 PM
I just finished updating this action to work with the new version of XR because i was also running into the same problem, it just detects if any VR device is connected or not.
Title: Re: XR Settings - Get VR device?
Post by: kavery on August 26, 2020, 05:16:49 PM
This will be awesome for another project where I'm using the proper XR manager. On the project at hand, we're still using the older Player Settings XR.

So far as a workaround I'm using some XR custom actions for XR Input (from MIT). 'Set XR Device Transform' has an event option for 'on no device' .. which is working so far. But the awkward part is there's no way to event 'device found' .. so I have to wait a short given amount of time where 'device not found' is NOT triggered, before I active components for the VR camera.

Thanks for the custom action!
Title: Re: XR Settings - Get VR device?
Post by: LordHorusNL on August 26, 2020, 07:06:03 PM
Sorry i couldn't help. ;D

In the older version UnityEngine.XR.XRDevice.isPresent would detect if the user has an HMD connected or not. Not sure if that would work with the version you're using though.
Title: Re: XR Settings - Get VR device?
Post by: kavery on August 26, 2020, 10:13:50 PM
That works dude. Thanks!!!
Title: Re: XR Settings - Get VR device?
Post by: LordHorusNL on August 27, 2020, 11:27:30 AM
Glad to hear it. ;D