How do I make a Marble Movement System?

Hello! So I’m trying to make a rolling movement system for a sphere I added in-game. I want the sphere and the character to roll when using the classic W, A, S, D controls. I have already created a weld script so the player spawns inside the sphere which I will leave below. Any help would be great!

Example of what I’m trying to achieve: > https://www.youtube.com/watch?v=xaEI5ojqOTc

Weld Script (Normal Script inside StarterCharacterScripts):

local Char = script.Parent

local Ball = game.ServerStorage.ball:Clone()

local Weld = Instance.new("WeldConstraint")

Weld.Parent = Ball

Weld.Part0 = Ball

Weld.Part1 = Char.HumanoidRootPart

Ball.Position = Char.PrimaryPart.Position + Vector3.new(0, 0, 0)

Ball.Parent = Char

I know how to make you in a Marble but sadly, I don’t know how to make it move “WASD”

I know you have to use BodyForce, it’s just I don’t know what to do from there.

Alright so I am not a fully experienced developer and haven’t made any objects dealing with movement and physics, but I have an idea now that I see that video you set as a demonstration.

You could use this sort of solution; Apply a BodyThrust object, to the marble model, that has a dynamic value for its BodyThurst. There can be 4 locations of BodyThrust and change their values/effectiveness on the marble depending on the keys detected on a client script, which would be ‘WASD’. BodyThrust allows to give an object, in this case a marble, a rotational force and movement at the same time.

BodyForce I think is used for fly in games, and is more just a center force moving the object a certain direction, which could instead add more force onto the ground when trying to move the marble while the scene is rotating, like that video example. So, best option is connecting ‘WASD’ from the client and then applying those dynamic BodyThrust points.

4 Likes