Implementing a virtual joystick with mouse

Hi,

I’m trying to implement a virtual joystick with the mouse and I’m having issues. I can’t just use the raw mouse data because sweeping gestures are important and these feel unintuitive with the raw input. I can easily achieve the desired effect with a real gamepad, but I want to try to emulate with a mouse. I think this would be easy if I could force the mouse to a certain value. Is there a way to do this, or has anyone else tried something similar?

tl;dr: I need to implement a mouse-driven virtual joystick, any help?

I don’t believe that you are making the right interface decisions if you require a joystick controlled by the mouse. If you are porting a mobile game to PC redesigning the interface to match the Keyboard/Mouse paradigm will be a better overall experience for the player. If you could give us more information as to what this Joystick is controlling that would help a lot as well.

Regardless Unity has an example joystick you could modify in Mobile Standard Assets.