# How to make a Spinner?

Hello!

I was wondering how can i possibly create a spinner app game for android.
What i want to do, is to spin the spinner based on the force of the roll, which is taken by the touch on the mobile phone(or the mouse in PC)

By now, all that i have, is that when i press click, the spiner rotates based on where the mouse (or the touch) is, so, its working the way i want, but when i released it, i don’t know how to give the spinnner (which is a BP) the info about the speed of the mouse (or touch) velocity. If you spin slowly, it will be slow, and if you pass the finger fast, then it will be faster.

And also i’d love to add velocity everytime, just as in real life, if when it is spinned you give it more power (based on the velocity of the finger or mouse) then it will spin faster.

Sorry about my english, it is not my native.

Thank you!

basically you can get how fast the player “passed the finger”, by detecting when and where the player pressed and released the button, (released location - pressed location)/(released time - pressed time).

Yea but what i do with the value of that? add to rotation or something?

this value says how fast the player “passed the finger”, so you can use it to tell how fast the wheel should spin, somewhere in your code you defined how fast the wheel spins, multiply this value by (released location - pressed location)/(released time - pressed time), and basically it will make the speed be proportional to the finger speed.

Dude, with this information i cannot tell if the player is spinning right or left. If i put just a number then it will ALWAYS rotate positive, even if the player ‘‘passed the finger’’ to the other direction.

Then multiply it by -1 if releasedFingerlocation.x < pressedfingerlocation.x