.Touched and .TouchEnded not functioning

I’m trying to make my CameraPart detect if it is touching the HitboxPart in order to set the “canPlace” value to true, though the .Touched and .TouchEnded functions do not work…

This is currently in a LocalScript in a Tool but I even tried to use ServerScripts inside the CameraPart and HitboxPart to test out the Touch functions, yet still nothing.

CameraPart.Touched:Connect(function(hit)
		if hit.Name == "HitboxPart" then
			ReplicatedStorage.Events.canPlace:FireServer(true)
		else
			print('nay')
		end
	end)
	
	CameraPart.TouchEnded:Connect(function(hit)
		if hit.Name == "HitboxPart" then
			ReplicatedStorage.Events.canPlace:FireServer(false)
		end
	end)

-- some runservice stuff here
1 Like

Check if CameraPart’s CanTouch is set to true or not.

2 Likes

If you are positioning the CameraPart by moving its CFame or Origin with PivotTo or Tweening, it will not trigger a Touched or TouchEnded with parts

1 Like

Yup my CanTouch was set to false, it works now, thanks :smiley:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.