Hey devs Im having problem with this bug rn where I want that when the player touches the ball he pushes the ball not kick it but pushes it like a little distance from him which will be used as a dribbling system but the ball doesnt do nothing at all here’s the code I have so far
Ball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local playerChar = hit.Parent
local direction = (playerChar.HumanoidRootPart.Position - Ball.Position).Unit
direction = Vector3.new(direction.x,0,direction.z)
local att = Instance.new("Attachment")
att.Parent = Ball
local force = Instance.new("VectorForce")
force.Parent = Ball
force.Attachment0 = att
force.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
force.ApplyAtCenterOfMass = true
force.Force = direction * 50
print("BALL WAS TOUCHED BY"..hit.Name)
end
end)