Ball Push bug Football game

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)	
2 Likes

are you sure that its not anchored (the ball) also
i noticed that the

print("BALL WAS TOUCHED BY"..hit.Name)

will just print what touched it so if i touch it with my leg it prints “BALL WAS TOUCHED BY Left Leg” depending whats the legs name and if its r6 or r15

2 Likes

Yes that’s exactly the print functions does but that has nothing to change in the code cause I was checking if everything works as it’s supposed to.

1 Like