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 site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
How do I make a cube fly along a single axis.
rigidbody, kinematic beginner woe
There is no 'Rigidbody' attached to the "Cube" game object, but a script is trying to access it,There is no Rigidbody attached to the Cube game object.
Rigidbody Falls Through Plane