Hi people ! Im really noob at game development and im having problems with the gravity in my game. What I want to make is that my players(multiple players son i cant rotate the sphere to solve the problem) can walk inside a sphere(Not outside like in mario galaxy…more like a hamster in a ball but without rotating the sphere)…so I need to make like all the surface of the sphere to have gravity or something like that …i searched and didn’t find anything…is this kind of gravity posible? apreciate any help thank you :D!
What you want to do is basically taking some sphere gravity system ( nice explanations in that thread http://forum.unity3d.com/threads/15191-Walking-around-a-sphere-gravity ) and reverse it. So instead of getting pulled towards the center of the sphere, you get pushed away from it to the edges.
Your problem now is collision detection with the sphere borders. The most efficient way IMO would be to check the distance from the center of the sphere and restrict movement. Pseudocode would look something like this:
if(player.position - center.position < range)
ApplyForce()
else
RemoveForceOrDoSomethingElse()