Help With Touched Event

For some reason the touch event doesnt fire when it touches something the touch event for “Hitbox”. However if it touches me then it fires. No output errors and its in a server script. So basically the player is using a projectile, whenever the projectile hits something it will make an “explosion” i teened the explosion to make it bigger. and if anyone touches the explosion/hitbox they get damaged

		Projectile.Touched:Connect(function(hit) -- WORKS
			if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= player.Name then
				local VCharacter = game.Workspace:FindFirstChild(player.Name)
				local vPlayer = game.Players:GetPlayerFromCharacter(VCharacter)
				Exp:SetPrimaryPartCFrame(hit.Parent.HumanoidRootPart.CFrame)
				TagHumanoid(hit.Parent:FindFirstChild("Humanoid"),vPlayer)
				Projectile:Destroy()
				wait(0.05)
				UntagHumanoid(hit.Parent:FindFirstChild("Humanoid"))	
				for _,v in pairs(Exp:GetChildren()) do
					if v:IsA("MeshPart") or v:IsA("Part") then
						local GoalSize = v.Size * SizeBoost
						local Tween = TweenService:Create(v,TweenInfo.new(1,Enum.EasingStyle.Linear),{Size = GoalSize,Transparency = 0.1,CFrame = v.CFrame})
						RemoveEffect(v,0.8,0.5,GoalSize*2,v.CFrame,1)
						v.Transparency = v.Transparency
						v.Parent =  workspace
						Tween:Play()
						wait(0.1)	
					end
				end
			end
		end)
		HitBox.Touched:Connect(function(hit) -- TOUCH FUNCTION DOESNT FIREEEEEE
			print("pls work")
		end)				
end)
1 Like

I’m pretty sure the Touched event is for when it’s either fired BY a player or when it touches a player. I don’t think it works for brick to brick touching.

And you would be wrong, Touched event fires if at least one of the parts is not anchored. It doesn’t matter if touching part is a part of a character model or not.

1 Like

Actually, the touched event fires when two parts come into contact with each other. This is the case for players too, as when a player touches a part, it fires with the part of the player’s character that touched it.

BasePart.Touched (roblox.com)

2 Likes

The problem that I am having is that the touch event fires only fires when a player touches it, any reasons why it does that? Because the first touch event fires when it touched a part however this one doesnt fire

What is the part that you are trying to make touch, and how are you moving it?

The part is a hitbox and its in a model. Basically I made an ability that shoots a projectile im using body velocity to move it, once it hits something it explodes. I tweened the explosion to make it bigger, etc. And if it touches anything it should print something, however it doesnt

I was wrong about the other thing I said but you should try put a print() before the few lines before the Touched event to make sure that it’s just an issue with the previous lines.

I think its because there is a wait for the for loop in the projectile.Touched event so the HitBox.Touched event doesn’t happen yet.

But it fires when a player touches it tho

Have you tried using the FastCast module? It has a similar interface to .Touched, except it’s more performant, still secure, and doesn’t miss.