Recent community posts
Hey, that's me!
Yea it's an AddForce on every frame.
The player's rigidbody has the physics engine gravity turned off and rotations frozen so the physics doesn't mess with our character without our permission.
The math is super straight forward:
Get a normalized vector from planet to player (player pos - planet pos), and do the AddForce on the rigidbody using the gravity vector * -gravity force.
Then you just align the transform's up vector to the gravity vector and multiply in the planet's rotation to add the planet's rotation to it. (Though I never rotated the actual planet.)
Hey Riki, I'm a programmer (mainly Unity / C#), have done a combination of professional, hobby, and game jam work over the years. I'd be interested in working on small projects. Let me know if you want to discuss, I'm also on discord.