Kenko was so good but had SO MANY health code violations!
The Steve
9
Posts
22
Followers
29
Following
A member registered Jun 01, 2015 · View creator page →
Creator of
Do what the thing is telling you to do and you'll be okay.
Action
Play in browser
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.)
Done!
itch.io Community » Game Development » Help Wanted or Offered · Posted in [Unity][Programmer] Seeking Programmer to make small games with me (3D Artist)
A Quiet Night In The Neighborhood comments · Replied to lvl_0 in A Quiet Night In The Neighborhood comments