Moving part does not register touching

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?

1 Like

I think you’re looking for :GetTouchingParts()

1 Like
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

Just prints {}

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.

1 Like

Uhh I actually did :nerd_face:
And it has cancollide on

Still does not work with PartsInParts