- Home /
rigidbody gravity Question ?
Hi guys i would like to find out how to add gravity to a rigidbody. When i start my game the player falls slowly and it takes him to long before he touches the ground. What i would like to do is i want my own var to act as the gravity when the game starts.
this is the var that i created :
var Gravity = -50;
now i want to add this to the rigidbody so that my player drops to the ground as soon as the game starts and also this must be done in the start function
:) Java script only please thanks in advance :)
Comment
Best Answer
Answer by DaveA · Mar 21, 2011 at 05:35 AM
You might want to use the existing variable Physics.gravity:
http://unity3d.com/support/documentation/ScriptReference/Physics-gravity.html
function Start()
{
Physics.gravity = Vector3(0,-50,0);
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613113921im_/https://answers.unity.com/themes/thub/images/avi.jpg)