Solar-System
Solar-System copied to clipboard
Gravity wont work on game build
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 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;
}