0
\$\begingroup\$

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?

\$\endgroup\$
3
  • \$\begingroup\$ How are you handling your gravity so far? \$\endgroup\$
    – DMGregory
    Commented Feb 16, 2021 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
    Commented Feb 16, 2021 at 21:51
  • \$\begingroup\$ Does the script I posted on this question help you? \$\endgroup\$
    – Philipp
    Commented Feb 17, 2021 at 9:23

0

You must log in to answer this question.

Browse other questions tagged .