Solar-System icon indicating copy to clipboard operation
Solar-System copied to clipboard

Gravity wont work on game build

Open Constructalor opened this issue 5 years ago • 1 comments

I tried to make a build of it but there was no gravity. I couldn't land on any planets and the planets ended up floating off into space. Also how can I edit the orbits of the planets like how it was done in the video?

Constructalor avatar Jul 09 '20 16:07 Constructalor

@Constructalor Had the same issue on the Episode_01 branch. I noticed that each planet had a mass of 0 in the builds and tracked it to needing to run the OnValidate() in the Awake of the CelestialBody.cs:

void Awake () {
      OnValidate();
      
      rb = GetComponent<Rigidbody> ();
      rb.mass = mass;
      velocity = initialVelocity;
}

ghost avatar Sep 17 '20 12:09 ghost