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 :)

1 Answer

1

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);
}

thank you mate

–

Thanks Exactly What i needed!

–

- Thanks, Coulnd upvote, so here's a comment like !

–