How to set a variable based on an object rotation?

I am making a throttle lever for an airplane. I have already managed to make my stick move with the mouse, rotating it on the Y axis based on the mouse position. So far so good. Now, how can I set a variable based on the position of that lever? I tried converting the rotation into a float that goes from 0 to 100 but the problem is the ■■■■ gimbal lock, that prevents to reach 100, it only reaches 90% and then goes down again in numbers.
Any clue how I could achieve this?

Here’s the script to make the lever (that haves physics constraint on it) moves with the mouse


As you can see, is a very simple script, if i click on Left mouse button, if i click on a physic object (in this case the throttle lever) i can drag it whetever i want

Here’s the script inside Grab Function

Now, i’m stuck … has i told you guys, i want to set a float based on the lever position, but have no idea how to set this up.
I’m using version 4.24 do to this.

lever_ref.fbx (26.0 KB)
lever_ref.uasset (115.2 KB)

I attach the gas lever i modeled

Pilot.uasset (167.0 KB)
I’m also providing the Pilot character, which is not the big deal, is just an empty character with a camera and a ball (lever_ref) attached to it to act like an object holder.