Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Part not being detected hitting another part?

Asked by 4 years ago

I am trying to detect when a player is on the ground or not so I made a part that will automatically go below the player's feet and a script I have isn't detecting the part.

Part creation Script:

local brick = Instance.new("Part")
local root = script.Parent.HumanoidRootPart
brick.Transparency = 0
brick.Name = "detector"
brick.Size = root.Size
brick.Anchored = true
brick.Parent = script.Parent
brick.CanCollide = true
while wait() do
    brick.CFrame = CFrame.new(Vector3.new(root.Position.x, root.Position.y - 4.5, root.Position.z), brick.CFrame.p + root.CFrame.lookVector)
end

Part Touched Script (In the part in workspace)

script.Parent.Touched:Connect(function(i)
    print(i.Name)
end)

It detects other parts but not the part I have under the player.

Answer this question