How can i make a script that make players be able to walk through a sphere?

I want to achieve a script that makes it possible for players to walk through spheres:


I’ve tried reading many forums but didn’t find any answers. Also, if possible, i’d like simple scripts, if that system doesn’t require many of them.
Thank you

by the way, im looking for something just like in Solar System Exploration 2 - Roblox

Just do it on the client. If the player is supposed to walk through the sphere, you can use a LocalScript to turn off collision for them. That way, they won’t collide with it, but other players still will.

local sphere = workspace:WaitForChild("Sphere")

-- the rest of your system to determine if the player has the ability to do this

sphere.CanCollide = false

Put that in a LocalScript (like in StarterPlayerScripts), and it’ll only affect that one player.

1 Like

You can’t really do this unless you have a system that give certain players this feature or power. Like in your example.

but that was his question. he wants to know how to create the script.

Yes, but we have nothing to go off of. I don’t know what kind of system he’s trying to make. I just gave the small skeleton of it.

I believe he wants to know how he could achieve an effect like planet Earth where he could walk on all sides of the sphere as if it had its own gravity, unfortunately I have never worked on this so I don’t know how to achieve it either.

i’m basically making a “survive the events” game and one of the maps is the earth, the game size will be 42-56 players or something

yeah! exactly! the exact same thing as Solar System Exploration 2 - Roblox does.

Hello. I’ve never tried what you want to achieve but I was doing some research and found some resources that might help. There is a system that is only a script that makes a gravitational system to the part: Planet Gravity System - Creator Store
I found this resource from this vid:https://youtu.be/MJH2DwiFjfA?si=EsC_xspXJzGbzS9g
Later in the vid he implents this feature to a space ship but I don’t think that’s what you want so you can just skip that part.
Hope this helps!

thank you! but i think it is a little outdated, because shift lock won’t work when using those scripts and also a little glitchy. but thank you anyways!

1 Like

If you want a fresh idea I’ve managed to think of one

Firstly you want to connect move events for each player when the round starts (player.Character.Humanoid.MoveDirection.Changed)

To keep the player from falling off the earth, apply a force on them with a VectorForce with the equation Force = playermass * -gravity

To reorient the player when they move, I’m proposing using Vector3:Cross() to get the direction they have to face. One vector is at least the player’s position relative to the centre of the earth and another being any non-parallel vector

Try using these starters to create the system you wanna achieve

Egomoose’s gravity controller achieves this

Otherwise, you could probably implement custom humanoid behaviour and then use the normal of whatever is below the player’s feet to orient the player. Then you’d use a VectorForce to counteract gravity while also applying a new gravitational force to the player (F=mass*-g like DrMystery said to counteract gravity, and then F=m*g.Magnitude*-normal to apply a new gravity)

you could make collision groups snd switch players in snd out of the spheres one.