Set a default positions to XR Device Simulator

Hi guys,
is there a way how to set a default positions to camera, left hand, right hand in XR Device Simulator? Right now it is always reset to zero position after start.

Thanks!

At the moment, there is no way to configure this. We are planning on improving the API to allow the simulator to be more fully customized including giving a set of sensible default poses for the HMD and controllers, but no timeline for when this will be done at the moment.

Hello there, is there any update on this?

Just wondering if I can save my default HMD and controller positions so I don't have to spend precious seconds positioning them every time I hit play. Thanks!

If anyone is interested, I wrote a helper script you can add to the XR Device Simulator prefab to save the position and rotation state of the HMD + controllers in PlayerPrefs between play sessions.

Tested with XRInteractionToolkit 2.0.3, may break in future versions as it access private member variables.

8401596--1109334--XRDeviceSimulatorPersist.cs (3.04 KB)

2 Likes

[quote=“geo_p”, post:4, topic: 829051]
If anyone is interested, I wrote a helper script you can add to the XR Device Simulator prefab to save the position and rotation state of the HMD + controllers in PlayerPrefs between play sessions.

Tested with XRInteractionToolkit 2.0.3, may break in future versions as it access private member variables.
[/quote]

Thank you. I also found out you have to restart the editor after adding XRDeviceSimulatorPersist otherwise it doesn’t work.

[quote=“geo_p”, post:4, topic: 829051]
If anyone is interested, I wrote a helper script you can add to the XR Device Simulator prefab to save the position and rotation state of the HMD + controllers in PlayerPrefs between play sessions.

Tested with XRInteractionToolkit 2.0.3, may break in future versions as it access private member variables.
[/quote]

I’m new to Unity so can you please explain how we should go about adding this script?

[quote=“georgia_gla”, post:6, topic: 829051]
I’m new to Unity so can you please explain how we should go about adding this script?
[/quote]
Drag it on top of a GameObject in the scene or click AddComponent in the GameObject and select XRDeviceSimulatorPersist. Goes without saying that first you have to drag it in the Assets folder as a XRDeviceSimulatorPersist.cs file.

1 Like

[quote=“chris-massie”, post:2, topic: 829051]
At the moment, there is no way to configure this. We are planning on improving the API to allow the simulator to be more fully customized including giving a set of sensible default poses for the HMD and controllers, but no timeline for when this will be done at the moment.
[/quote]

It’s been three years, and here we are. The fact that this wasn’t simply a serialized field on the component to begin with baffles me. The default values are great too: here are controllers right on your face, regardless of whether you want to use them.

2 Likes