Rotate Valve with Mouse like in Amnesia

Hi there. I’m currently stuck at the mechanics for rotating a valve or wheel with the mouse. I want to make it like they did in Amnesia where the player has to mimic the rotation of the valve with the mouse. (“Drawing” circles clockwise or anticlockwise)

I have a setup that makes a direction out of mouse x and y and gets the rotation from it but that seems to work only on vertical mouse movement and gets jittery at horizontal mouse movement.

Does someone know how to do this properly or how they did it in Amnesia? Thanks in advance!

After some research I found out, that Amnesia does this with real physics, constrains and springs (I think we don’t have springs in UE). But using real physics like a physics handle is not an option since I have to detect how many full turns the valve does. I came up with a solition that centers the mouse cursor on interacting with the handle and then finds the look at rotation based on cursor position and viewport half-size. It’s not super elegant but it works since we don’t have a visible mouse cursor. Here is the Blueprint if anyone is interested. I leave the topic open. maybe someone has an even better solution to this since mine is just a hack :wink:

EDIT: here is the link to informations on how it works in Amnesia: http://www.codingser.iblogger.org/2017/04/22/amnesia-interactable-door-and-valve-physics/