Hi guys!
I'm trying to implement a draggable sprite. When the user ends the drag touch, the sprite should continue to move a bit due to its velocity slowing down. The idea is to to make something that works like a normal iPhone view really. It has lots of uses I think, like scrolling text or moving around in a map for instance.
I have something working, but it doesn't have the right feeling.
What I'm doing is simply calculating the speed ((touch.x-previousTouch.x) / (touch.time - previousTouch.time)) in SPTouchPhaseEnded. I then slow it down a bit in each frame until speed is 0. Like this really: http://www.mindthecube.com/blog/2010/09/adding-iphone-touches-to-unitygui-scrollview
Is this a sound approach or is there a better/smarter way of doing it?
[I'll post the code later. Need to clean it up first
]