.Touched event only detecting one character?

Right now I’m making a fighting game but the collisions suddenly stopped working?

Here’s just the collision part of the script:

bone.Touched:Connect(function(hit)
			print(hit)
			print(hit.Parent)
			print(hit.Parent:FindFirstChild('Humanoid') and not hit:FindFirstAncestorWhichIsA('Model') == player.Character)
			if hit.Parent:FindFirstChild('Humanoid') and not hit:FindFirstAncestorWhichIsA('Model') == player.Character then
				bone:Destroy()
				hit.Parent:FindFirstChild('Humanoid'):TakeDamage(8)
			end
		end)

Whats bring printed:

The bones are clearly touching the dummy but it’s not detecting it.
Does anyone know why this is happening and how to fix it?

1 Like

The .Touched event is only triggered when two parts collide in a physics calculation.

From your video, I assume that you’re lerping/forcing the position of the object. Thus, not triggering the .Touched event since the position of the object is being forced. For physics to be calculated on an object, it has to be moved by a force.

You have two options:

  1. You could fire a raycast from the start position of the bone to the end position of the bone. If there’s a hit, do something.
  2. You could apply a force in a specific direction, thus triggering the .Touched event. The velocity can be calculated by the good old velocity formula. Velocity = Speed / Time. You would have to add that velocity to the direction of the bone while maintaining its Y velocity so it doesn’t drop.
1 Like