How to make a 3D gui slider in webVR?


I am following the threejs webvr dragging example and it is working fine.

I am trying to add a 3D slider that is constrained to move along the x axis. I am bit confused as how to do this. How would I adapt this code to work as a slider? Thanks.

Just for my understanding: Is your slider (far) away from the user or is it possible to grab the slider with the controller?

The code you have linked is not suitable for all scenarios since it makes the dragged object to a child of the controller. If you then move the controller around, the object is automatically transformed.

Oh yes. I was a bit confused about how it was adding the object to the controller. Why is it doing that?

Is there a more straightforward way to do a slider? Seems like a really useful feature for building a small 3D-gui. But this webVR dragging code is quite complicated for me.