Touch Events not working


I am making a portal like game and this cube will fire an event when it touches the button, here. It keeps randomly firing the TouchEnded funcion and Im not sure why

for i,v in pairs(game.Workspace.Items:GetChildren()) do
	v.Touched:Connect(function(hit)
		if hit.Name == "ButtonPart" then
			hit.Trigger:FireServer()
		end
	end)
	v.TouchEnded:Connect(function(hit)
		if hit.Name == "ButtonPart" then
			hit.RTrigger:FireServer()
		end
	end)
end

Is this a physics bug or did I just pull a stupid

Touch ended will start and finish on the slightest movement. I suggest you make the server wait and check again if it is touching or change your methods of detecting if it is on the pressure plate or not. Maybe think about checking it on the server using raycasts.

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