Getting mouse input in screen (0,0) and drag mouse
I would like to make a slingshot game, So I'd like to make something like a joystick but invisible. if I click my mouse somewhere in my screen and release my object will travel 7 units in Z axis. But if I drag my mouse down for 3 units I want my ball to travel 15 units and if I drag it up 3 units my object will travel to 1 unit in Z axis. Same goes for right and left but in X axis and between -3 to 3
The problem here is I have no idea how to get where I clicked as 0,0 and limit drag to (-3,3) both up down and right left.
Just to be clear let me give an example. If I click and release my mouse without moving it, my object will travel to (0,0,7) if I click and drag my mouse to down for 2 units and to right 1 unit my object will travel to (-1,0,11.66...). You can just picture angry bird but in 3D. I'd be glad if someone helps me out. I'm working on it for 3 days could not find any tutorials and I have nothing.