So basically, I’m trying to detect if the player is still touching a part or not, but I’m having some problems with it. When someone stands inside the part and jumps, the bool value disappears, even if they are still in the part. (The part has no collision and is higher than the character). How can I fix these issues, or is there another method for hit detection? Script below.
script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
if hum:FindFirstChild("Capturing") then
else
local capturing = Instance.new("BoolValue")
capturing.Name = "Capturing"
capturing.Parent = hum
end
end
end)
script.Parent.TouchEnded:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
if hum:FindFirstChild("Capturing") then
hum.Capturing:Destroy()
end
end
end)