Keep GameObject anchored to position on zooming screen?

I’m using the Leap Motion Widgets and I’m trying to use one of the special sliders to zoom the camera. I have the slider modifying the value of Camera.fieldOfView, and it works.
The problem here is that zooming in on the camera zooms in on everything (of course), including the slider widget itself.

How do I keep the widget anchored to the camera such that its position and size don’t change when the camera zooms? (If it’s possible.)

I need to keep the slider interactive with the Leap Motion controller + virtual hands.

Hello!
I see several possible ways to solve your problem

  1. You can change local scale or z-coordinate of your slider synchronously with changing Camera.fieldOfView. I.e. if you increase fieldOfView, the slider became smaller. So you can increase its localScale or make it closest via z-coordinate.

  2. Use separate (orthographic) camera for slider. As a result, fieldOfView will not change your slider

  3. Draw your slider with new or old Unity GUI

Hope my advices could help you:)

P.s. If anyone knows other solutions, it’s very interesting for me!