How to make a player Marble

Hi everyone! I’m trying to make a Marble-Player like some games already known, making it going in all directions, jump and gain velocity

The problem is that i have no idea of how to do it, i have already visited a lot of topics like this and got only scripts on scripts that didn’t work or just got problems.

I know that you must Weld the player and the Marble to make them one inside the other but idk how to do this for good, if anyone knows any good tutorial (i didn’t find any…) or can show me how to do will be really good

You don’t need to create the entire script, just need a good explanation and some example if you want

Thanks everyone!

(Sorry for bad eng)

3 Likes
  1. Create the marble part

  2. Create a WeldConstraint with the Part0 and Part1 set to the marble and the player’s torso or HumanoidRootPart

  3. If the player tries to flail around inside the marble, call humanoid:ChangeState(Enum.HumanoidStateType.Physics) in a LocalScript

  4. In a LocalScript, every time humanoid.MoveDirection changes, send it to the server via RemoteEvent

  5. In a server Script, use a BodyMover of some sort such as a BodyForce to move the marble in the direction sent by the LocalScript

4 Likes

Ok i’ve tried it and got stuck on the 5th point, when pressing WASD i can see the value of the RemoteEvent change like “0,0,1” , “0,0,-1” and so on but when using a script it always print “NAN, NAN, NAN” or “0,0,0”

test
NOTE: Green is Script and Blue is Local Script

Basically, when the player moves the local script gives the axis to remote event that has a Vector3 value and then it should be read by the script

Any tips about it?

Not sure why you are getting the NANS but I just remembered that you shouldn’t need the RemoteEvent system after all. If you parent the marble part to the player’s avatar Model, then its position should be replicated automatically when changed by a LocalScript just like your other body parts. Try doing the BodyMover code in the LocalScript instead and see if that works.

1 Like

Mhh i’m gettin trouble about this, idk much on how to do, i got only some strange activity like:

I’m in the Marble and can’t move
Put the marble inside the player >>> Nothing
Put the marble outside >>> Nothing
Put it again inside >>> I can move without rotation (even using BodyForce) but it starts moving or just wait like 20 sec and it starts moving without rotation

Alright, could I see all of your server and client side code please?

Yeah, i put a photo with values and other things

Local Script 1 (Axis)

 wait(5)
local Player = game.Players.LocalPlayer.Character.HumanoidRootPart
	workspace.Marble.Parent = Player.Parent

while true do
	test = (game.Players.LocalPlayer.Character.Humanoid.MoveDirection.Unit)
	print(test)
	workspace.Axis.Value = test
	
	Player.Parent.Marble.BodyForce.Force = test * workspace.Gravity
	wait(.5)
end

Local Script 2 (Marble Start)

print("TEST1")
wait(.1)

game.Players.LocalPlayer.Character.Humanoid.Animator:Destroy()
game.Players.LocalPlayer.Character.Animate:Destroy()

wait(.5)
local Marble = workspace.Marble
local Wedge = workspace.Wedge

local Player = game.Players.LocalPlayer.Character.HumanoidRootPart

local weld = Instance.new("Weld", Marble)
weld.Part0 = Marble
weld.Part1 = Player
print("TEST")

sdsad

Note: Wedge has been used only for weld tests, is actually useless

1 Like

Is the MoveDirection property changing at all when you’re inside the marble?

If you mean the axis yes, when pressing WASD it changes and also changes the “Axis” Value
You can also try it in studio, it’s all in there

1 Like

Try adding humanoid:ChangeState(Enum.HumanoidStateType.Physics) at the start of one of the local scripts. Also I should probably mention, I think you’ll need to parent the marble to the player’s character on the server in order to achieve replication.

1 Like

I also noticed that maybe the BodyForce has been used as push force but only when the player try to touch it, i got pushed away a lot some times

1 Like

EgoMoose has made an open sourced place on how to do it here:

1 Like

Yeah that’s good, now i just need to extract the script with basic movement, i need only something like Super Blocky Ball

1 Like

Ok so i have searched for a bit but can’t find what i need exactly, i’m trying to use the marble ad Vehicle but still can’t move, if anyone knows please tell

1 Like

Hey, i might be late, but i have your solution, i have a yt channel where i make player marbles vids and this video answers your question: How To Make A Controllable Player Marble COMPLETE With Fixed Jumping In Roblox Studio - YouTube