I am trying to make planet physics in my UPBGE game where all objects obey gravity relative to the center of a sphere. I have tinkered with a couple of tutorials to no avail which, on the surface seem simple, but I cannot get to work properly in UPBGE. Any ideas on how to do this? Nothing fancy, just local/global gravity set to the center of a sphere as opposed to the Z axis.
It’s been a while since i’ve run through that tutorial. Hold on, let me see if I can pull the file back up… I do remember that there was a python error and the gravity just reverted to the standard bullet physics gravity.
okay so I remember what happened with that particular tutorial. I couldn’t get the player to stick to the planet, it would just continually fall off even though the “gravity” property was set to the player. I thought at first it might have to do with the character physics being set, but that wasn’t it. Here’s a reference .blend for more info. Press “W” to move the character forward. planet_physics.blend (818.7 KB)
Ah, I found the error. You set the controlled objects physics to character. I’m not sure why, but that particular setting cannot be used. I guess it is because that physics is made for games where up is Z+.
Change it to Rigidbody or Dynamic and it works : D
I’m not sure it is possible I don’t think the character physics can properly handle multi axis rotation.
In the file you uploaded it falls down the Z- axis no matter how you set the rotation, and even though you disabled world gravity.
If I understand character physics correctly, it is only meant to rotate around the world Z axis, and upwards is defined as the world Z+ axis.
In other words, it is specialized for flat worlds and so cannot work properly on round ones.
Well, I guess the character physics aren’t entirely necessary, I just like the ability to be able to set a max jump number, angle limits and to get rid of that stupid sliding that always happens with Dynamic and Rigid Body physics