Mouse Swipe logic for PC/MAC

Hello all,

Likewise, we use “touch.detlaPosition.magnitude” to detect the magnitude of the change in position of our touch in i-phone or android. How can we use a mouse in MAC/PC to detect the change in magnitude from the button press till user releases it?

Purpose:-
Initially, I used the finger touch on iphone device to swipe my finger from bottom to top to apply force to some rigidbody.
And Now,
I want to do the same on mac, that a user flicks by pressing the mouse button (0) from bottom to up and it apply some force on the rigidbody, depending on the change in position of the mouse and how quickly it changed.

Any help would be appreciated.

Thanks.
…Liven…

You could write a simple script:

On Input.GetMouseDown

Save mouse pos.
Save time

On Input.GetMouseUp

calc dist. travelled
calc time taken

apply this info as you see fit.

There is also this: