playMaker

Author Topic: XR Settings - Get VR device?  (Read 1383 times)

kavery

  • Full Member
  • ***
  • Posts: 149
XR Settings - Get VR device?
« 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.

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: XR Settings - Get VR device?
« Reply #1 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.

kavery

  • Full Member
  • ***
  • Posts: 149
Re: XR Settings - Get VR device?
« Reply #2 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!
« Last Edit: August 26, 2020, 05:19:19 PM by kavery »

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: XR Settings - Get VR device?
« Reply #3 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.
« Last Edit: August 26, 2020, 07:11:27 PM by LordHorusNL »

kavery

  • Full Member
  • ***
  • Posts: 149
Re: XR Settings - Get VR device?
« Reply #4 on: August 26, 2020, 10:13:50 PM »
That works dude. Thanks!!!

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: XR Settings - Get VR device?
« Reply #5 on: August 27, 2020, 11:27:30 AM »
Glad to hear it. ;D