I am having a problem with momentum of an object after releasing a touch from the iPhone.

I am at an impasse. I can touch an object with my finger and it will follow the movement. What I then want is for the object to continue in a decaying arch once I have picked up my finger. I have all of my touch controls in the FinalUpdate function. Any help would be appreciated.

more ▼

asked Mar 19, 2010 at 01:33 AM

avatar image

22 24 16 26

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

If your object is a rigidbody you could add a force to it that is proportional to your finger's movement speed before you release the object.

If it's not a rigidbody you could implement a kind of smoothing for the acceleration of the object. On release start a coroutine that interpolates you movement speed between last known speed and 0 over a given time.

more ▼

answered Mar 19, 2010 at 09:43 AM

avatar image

6.6k 119 110 171

I think there could be a better method to this problem. I have a ray going from the mainCamera to the object and I have noticed that this ray will point in the direction that I want. So I can take the ray's direction and notice that the x value is negative then throw left. If the ray's direction has a x value of positive, the I know it should throw right.

Mar 19, 2010 at 06:42 PM Ed
(comments are locked)
10|3000 characters needed characters left

This tutorial has an interesting inertia code after dragging and rotating an object, you might find it useful.


source code is here:


more ▼

answered Jun 21, 2011 at 01:09 AM

avatar image

101 4 5 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Mar 19, 2010 at 01:33 AM

Seen: 2035 times

Last Updated: Jun 21, 2011 at 01:09 AM