- Home /
Answer by yant · Jul 29, 2013 at 09:25 AM
Have a look here:
http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.AddForce.html
Just add some force to it, or set velocity directly (if you do not want acceleration process to be here):
rigidbody.velocity = new Vector3(speedX, speedY, speedZ)
Please note that you can always assign Physics Material to rigidbodies and tune up dynamic and static friction to customize how long does it take a body to completely stop. This may add some realistic properties to your stuff.
we have to apply script in player or the object we have to push?
Answer by koushik.s · Jul 29, 2013 at 09:12 AM
You can add force to rigidboy with simple line of code like, rigidbody.AddForuce(Direction); or rigidbody.velocity = direction to the gameObject it will move in the direction. Go through the Unity3d scripting manual
Your answer
![](https://koobas.hobune.stream/wayback/20220613111112im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Method for grabbing rigidbody 2 Answers
Manually check collision ? 1 Answer
Rigidbodies push other rigdidbodies 1 Answer
Simple two cube collision is not good? 0 Answers
Best way to throw object 0 Answers