Im using unity and I want to make a game where you can walk around small planets and the further away you get, the weaker the gravity, so you can go to other planets. All the tutorials so far only work with one planet, how do I code this? Is there anything I can download that does it for me?

  • \$\begingroup\$ How are you handling your gravity so far? \$\endgroup\$ – DMGregory Feb 16 at 20:50
  • \$\begingroup\$ You can add forces to your objects pointing in any direction you like. So walking around the surface of a planet should be a matter of adding a force to simulate acceleration towards the centre of mass. If you have multiple moving planets and want accurate gravity continuously between them, things get rather more complex \$\endgroup\$ – Basic Feb 16 at 21:51
  • \$\begingroup\$ Does the script I posted on this question help you? \$\endgroup\$ – Philipp Feb 17 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.