Raycast Rotation on Steering Wheel

I am trying to set up a steering wheel and was wonder how to go about detecting a raycast rotation to turn the wheel. Not sure where to start.


Basically, you want to act as if you had your hand on the whell I guess. You hold a mouse button, then turn the wheel, is that right ?

Raycast on mouse down to know if you’re over the wheel, and for that only (you’ll need a collider btw, a cylinder would be nice. Then store your mouse position on the screen at that moment, and the position of the center of the wheel, still on screen coordinates. That gives you the vector2D center → startPoint, and you can now calculate the angle each frame between that vector and center → currentPoint. Then, set the wheel rotation to that angle.