:GetTouchingParts() not detecting character parts

  1. What do you want to achieve? I’m trying to make a part detect if a player is standing on it and if it does it needs to change the team and respawn the player.

  2. What is the issue? It doesn’t detect the parts of the character.

  3. What solutions have you tried so far? I’ve tried looking on the Developer Hub for solutions, but I didn’t find anything.

This is the Server Script: (Not the complete version, only the important part)

game.ReplicatedStorage.FourCorners.OnServerEvent:Connect(function(player, killColor)
if killColor == "Green" then
		print("killColor is Green")
		local parts = game.Workspace.ActiveMaps.FourCornersMap.Green:GetTouchingParts()

		for _, touchingPart in ipairs(parts) do
			print("Part")
			if touchingPart.Parent:FindFirstChild("Humanoid") then
				print("Part is a character")
				local player = game.Players:GetPlayerFromCharacter(touchingPart.Parent)
				player.TeamColor = BrickColor.new("White")
				player:LoadCharacter()
				
			end
			
		end
		
	end

And this is the Local Script:

script.Parent.MouseButton1Click:Connect(function()
	
	game.ReplicatedStorage.FourCorners:FireServer("Green")
	
end)

And here is a video of the issue:
https://gyazo.com/944bd11431f9d09150ab4baca588804e

2 Likes

Yep that is supposed to happen. Get touching parts only accounts for CanCollide parts. The legs and arms have collisions disabled, so they aren’t accounted for. I personally use Region3, if my region doesn’t need to rotate or move, since you can’t do that with a Region3, and since it does account for parts without collisions.

9 Likes

As @incapaxx mentioned the players arms and legs have CanCollide disabled, luckily buildthomas made a function for getting touching non cancollide parts

1 Like

That method is hacky. I wouldn’t rely on it. Region3 would be better here assuming he doesn’t need a moving/rotating platform

I’ve figured out how to use Region3 now, thanks for the tip! :slight_smile:

CLOSED