Planet Gravity Help

So I want help with this one kind of script thing where, you can float everywhere (i already made it)
But I want some help on making a script which where if I stand on a sphere, my character is kind of glued to it and can walk around it.

I reckon CFrame knowledge is included.

I do not have any videos to make it simpler but, you could check out games with solar planets.

1 Like

You’d need to make a system which you can walk around sphere’s, I suggest rotating everything around the player (but do this client-sided) so he can walk on a sphere.

1 Like

I do not get this, If I were to rotate it, wouldnt the player stay in the same location?

1 Like

Ive made real planet gravity before but it has some issues. (Not made for players, made for masses of individual parts)

The best thing to do is create two spheres. one being the planet, one being a gravitational field. when they are in the field pull the player towards the planet and rotate the player

Heres my script:

I dont recommend using it for your purpose. (It uses NASA’s gravity equations to make real grav so its not best for players)

1 Like

I’ll be sure to check that out, if it does I’ll mark this as the solution and thank you very much.
I will probably modify it to make it usable for players.

I dont know how much use it will be as it uses the parts mass and other factors to create gravitational pull. It doesn’t align rotation.

But feel free to try it if you must.

I must try it, or this thing I’ve been working for well over 1 month wont work.

If it doesn’t work, I’ll try implementing a gravity controller.

It also takes the planets size into account. Its suppose to simulate real gravity.
It could be modified to change that and to also rotate players but it would take some work.

Here’s a clip of about 700 parts being flung around it with velocity
https://gyazo.com/65057dffaf6528f12f9185ea354d932a

So I just put the script in the second sphere?

The script is full of functions
This is final function

CreateGravityObject(Object, Range, Constant, EffectsObject)

the script can be anywhere and one script can do all of your planets (I think not 100% sure).
Theres no need to create a second part as it does that itself.

It will take quite a bit of messing around to get the gravity you want.

1 Like

I do not get this script, I think I’ll just go with a gravity controller I made a couple months ago.

I’ll have to rewrite this script though, since it’s not compatible now.

1 Like