I have a cube...
I apply addforce to the cube:
how I can slow down the cube little by little?
Answer by save
May 18, 2011 at 01:06 AM
As Joshua said the amount of drag will slow down the cube over time. You could also apply forces in the opposite direction of the rigidbody.
Sorry for this somewhat pseudo code as I cannot test it out at the moment.
currentVelocity = rigidbody.velocity;
oppositeForce = -currentVelocity;
You probably want to multiply that opposite force by a small factor to slow down the rate of deceleration.
Yes perhaps a Vector3.Lerp from 0 to -currentVelocity would do the trick.
Answer by Joshua
May 18, 2011 at 12:34 AM
Increase the drag over time? Decrease the velocity of time?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
No one has followed this question yet.
How do I make a cube fly along a single axis.
Cube moving through rigid body
rigidbody, kinematic beginner woe
Issue w/ Difference between Cube and Capsule