Ball Movement System Only Tilts

I’m trying to create a ball movement system. My code is based on a marble script by RetroAmythest. The problem is the player doesn’t roll, they just kinda tilt forward like in this screenshot.

Screenshot 2024-07-09 at 12.34.40 PM

local replicatedStorage = game:GetService("ReplicatedStorage")

replicatedStorage.BallHandler.OnServerEvent:Connect(function(player)
	local char = player.Character
	local HRP = char:WaitForChild("HumanoidRootPart")
	local marble = char:WaitForChild("Marble")
	local Velocity = Instance.new("BodyAngularVelocity")
	Velocity.Parent = marble
	local Hum = char:WaitForChild("Humanoid")
	while true do
		wait()
		marble.BodyAngularVelocity.AngularVelocity = Vector3.new(char.Humanoid.MoveDirection.z * 32,0,char.Humanoid.MoveDirection.x * -32)
		marble.BodyAngularVelocity.MaxTorque = Vector3.new(10000,10000,10000)
		if char.Humanoid.MoveDirection == Vector3.new(0,0,0) then
			marble.BodyAngularVelocity.MaxTorque = Vector3.new(0,0,0)
		end
	end
end)

Just tell me if you need anything else!

1 Like

the code seems correct, can you send a video?

It says the file is too big and that I need to use a cloud-sharing service?

this is one of them. free, no access and fast

Thank you! Try this: Watch Screen Recording 2024-07-09 at 12.46.01 PM | Streamable

maybe is wrong, but try to add a BodyAngularVelocity.P and put a high value

if this doesnt work then try to replace this

with this (is just a test)

	marble.BodyAngularVelocity.AngularVelocity = Vector3.new(360,0, 360)

I tried both, but it remained the same. Here’s my new code with the changes:

local replicatedStorage = game:GetService("ReplicatedStorage")

replicatedStorage.BallHandler.OnServerEvent:Connect(function(player)
	local char = player.Character
	local HRP = char:WaitForChild("HumanoidRootPart")
	local marble = char:WaitForChild("Marble")
	
	local Velocity = Instance.new("BodyAngularVelocity")
	Velocity.Parent = marble
	Velocity.P = 10000
	
	local Hum = char:WaitForChild("Humanoid")
	while true do
		wait()
		marble.BodyAngularVelocity.AngularVelocity = Vector3.new(360,0,360)
		marble.BodyAngularVelocity.MaxTorque = Vector3.new(10000,10000,10000)
		if char.Humanoid.MoveDirection == Vector3.new(0,0,0) then
			marble.BodyAngularVelocity.MaxTorque = Vector3.new(0,0,0)
		end
	end
end)

try with this one, or else i have no idea

BodyAngularVelocity.P = math.huge
BodyAngularVelocity.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
BodyAngularVelocity.AngularVelocity = Vector3.new(1 ,0, 1) * math.rad(360)

i tested this one and works

It still doesn’t work for me, could I see the setup that it worked for you in?

I misread the title. Time to get a new brain.

It’s still not solved. Feel free to give any of your ideas!