local t = 0
local i = 0
while true do
i += 1
t += 10
local c = workspace.MainPart:Clone()
c.Touched:Connect(function(touchee) -- Here, it wont recognize the part it touched
print(touchee.Name) -- Prints nothing!!!!!!!!!!!!!!!!! >:(
end)
c.Parent = workspace
c.CFrame = CFrame.new(-t, 10, 0)
wait()
c:Destroy()
--print("Frame: "..i)
end
When I place a barrier in front of it, it does not register any touching, how would I fixed this?
local t = 0
local i = 0
local d = 0
while true do
i += 1
t += 10
d += 0.01
local c = workspace.MainPart:Clone()
print(c:GetTouchingParts()) -- Just prints {}
c.Parent = workspace
c.CFrame = CFrame.new(-t, 10-d, 0)
wait()
c:Destroy()
--print("Frame: "..i)
end
You probably didn’t read the actual documentation, but you should make sure that workspace.MainPart has CanCollide set to true, and you should probably be using workspace:GetPartsInPart() anyways.