|
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.
(comments are locked)
|
|
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. 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 '10 at 06:42 PM
Ed
(comments are locked)
|
|
This tutorial has an interesting inertia code after dragging and rotating an object, you might find it useful. http://www.youtube.com/watch?v=oOfPMKdJdKk source code is here: http://www.revelopment.co.uk/tutorials/unitytutorials/73-howtorotateanobjectbytouch
(comments are locked)
|
