In my game I’ve got 2 scenes: One called Outer Space → Where my spaceship flies, and the another scene called Planet → where my ship lands… And as I started working in the first scene, I changed in the Project settings the gravity to 0 and when I went to my planet all my things started flying.
SO,THE QUESTION IS how to set the gravity in my planet (scene) to 9.81 m/s^2 if I want the Outer space gravity = 0?
Thanks!
Hey you can use a script in the scene that implement this method
When you can insert in both scenes.
Scene 1 as 0,0,0
Scene2 as 0,9.3f,0
c#
[SerializeField]
private Vector3 newGravity;
private void Start()
{
Physics.gravity = newGravity;
}
or
UnityScript :
Vector3: newGravity;
function Start()
{
Physics.gravity = newGravity;
}
It could be easier to just change the gravity scale in the inspector, in the Rigidbody component