Need Help Expanding Ball Weld System Into Full Dribble + Kick Mechanic

Hi everyone,

I’m working on a Blue Lock–inspired soccer game and I’m trying to build a ball control system similar to what you’d see in Azure Latch or anime-style soccer games.

So far, I’ve created a basic weld system that works like this:

  • When the player touches the ball, it welds to their HumanoidRootPart
  • The ball moves with them while walking
  • It uses a WeldConstraint and stops other players from picking it up

Here’s the script I used (If there’s anything I can do to make it function better please let me know):

local ball = workspace:WaitForChild("Ball")
local Players = game:GetService("Players")

ball.Touched:Connect(function(hit)
	local character = hit:FindFirstAncestorWhichIsA("Model")
	if not character then return end

	local player = Players:GetPlayerFromCharacter(character)
	if not player then return end

	if character:FindFirstChild("HasBall") then return end

	local hasBall = Instance.new("BoolValue")
	hasBall.Name = "HasBall"
	hasBall.Parent = character

	local hrp = character:FindFirstChild("HumanoidRootPart")
	if hrp then
		ball.CFrame = hrp.CFrame * CFrame.new(0, 0, -2)

		local weld = Instance.new("WeldConstraint")
		weld.Part0 = ball
		weld.Part1 = hrp
		weld.Parent = ball

		ball.Anchored = false
		ball.CanCollide = false

		print(player.Name .. " picked up the ball!")
	end
end)

What I’d like help with:

  1. How can I make the ball move smoothly around the player, like a dribble circle?
  2. Should I switch from Welds to AlignPosition, CFrame, or something else for smoother movement?
  3. How would I later add a kick system with a power bar + directional shooting?

I’m not using free models — I’m learning Lua from AlvinBlox and doing everything myself. I just want to make sure I’m going about this the right way, and I’d love any advice on structure, animation syncing, or future expandability. I’d love to get better at writing clean and expandable code, so I appreciate any feedback — even if it’s small.

Thanks in advance!

The easiest method is replacing the weld with a Motor6D and instead animating it, I believe this is what most blue-lock games do.

For kicking, it depends on how you want security.

I’d use a loop on the client for charging shots since I prefer player experience over security, but you could also do calculations on the server.

For directional shooting, send the direction the camera is facing and use that. You could also use the direction the player is facing on the (X and Z?) axis to make sure they can only shoot straight forward.

2 Likes

Thanks so much! This helped me a lot — I really appreciate the time you took to break it all down.

I’ll try to apply everything you mentioned: switching to Motor6D, charging the kick on the client, and using the camera’s look direction. Super helpful tips and I can already tell this will make the system feel way better.

Thanks again, and hope you have a great day too!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.