the football is supposed to be right infront of the player’s foot not on the ground, considering the roblox cframe is weird
script:
local futbol = script.Parent
futbol.Touched:Connect(function(hit)
futbol:SetNetworkOwnershipAuto()
if hit then
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
futbol:SetNetworkOwner(player)
futbol.Parent = player.Character:FindFirstChild("RightFoot")
if futbol.Parent == player.Character:FindFirstChild("RightFoot") then
futbol.CanCollide = false
local motor6d = Instance.new("Motor6D")
motor6d.Parent = player.Character:FindFirstChild("RightFoot")
motor6d.Part1 = futbol
motor6d.C0 = CFrame.new(-0.10,0,-5)
local weld = Instance.new("WeldConstraint")
weld.Parent = futbol
weld.Part0 = futbol
weld.Part1 = player.Character:FindFirstChild("HumanoidRootPart")
futbol.Position = player.Character:FindFirstChild("RightFoot").Position
local foot = player.Character:FindFirstChild("RightFoot")
end
end
end
end
end)
I think your problem is that you’re not considering that CFrame handles both Position and Orientation, so if you want to fix this, you should adjust the C0 of the Motor6D
Adjust this portion of your script:
motor6d.C0 = CFrame.new(0, 0, -0.5) -- Adjust position relative to foot
You can also adjust this portion of your script to help you be able to manually change the position of the football in relation to your foot.
-- Position the football in front of the foot (if needed)
futbol.Position = player.Character:FindFirstChild("RightFoot").Position + Vector3.new(0, 0, -0.5)
To make sure the football is positioned correctly in front of the player’s foot (rather than on the ground), you need to adjust the CFrame of the football according to the player’s RightFoot.