Clickdetector not working in parts inside of the character

I’m parenting and welding a part to each character’s humanoidrootpart to act as a hitbox of sorts with a clickdetector which should print “activated” but for some reason, it doesn’t. The clickdetector works when the hitbox is put in a dummy, but not when inside an actual character. The server script to add the hitbox to the player contains the following:

local ChallengeHitbox = ReplicatedStorage:WaitForChild("PlayerChallengeHitbox")

Players.PlayerAdded:Connect(function(Player)
	local PlayerValues = Values:Clone()
	PlayerValues.Parent = Player
	
	Player.CharacterAdded:Connect(function(character)
		local PlayerChallengeHitbox = ChallengeHitbox:Clone()
		PlayerChallengeHitbox.Parent = character
		
		local Weld = Instance.new("WeldConstraint")
		Weld.Parent = character.HumanoidRootPart
		Weld.Part0 = PlayerChallengeHitbox
		Weld.Part1 = character.HumanoidRootPart
		PlayerChallengeHitbox.CFrame = character.HumanoidRootPart.CFrame
		PlayerChallengeHitbox.Script.Disabled = false
	end)
end)

And the script inside of the hitbox simply contains the following:

local ClickDetector = script.Parent.ClickDetector

ClickDetector.MouseClick:Connect(function()

print("activated")

end)

So the server script is supposed to enable the script inside of the hitbox after the hitbox is welded and parented to the player, and as soon as it enabled, the hitbox script should simply allow the game to print a statement when the clickdetector is clicked on. Thanks in advance :slightly_smiling_face:

Is your click script inside of the ClickDetector, or the hitbox? Also, are you getting any errors?

The script is inside the hitbox and there are no errors.

@trapiz

Firstly are you sure the “PlayerChallengeHitbox” is in the character? for example, it may not be Anchor and falls off the character.

Secondly, when you move the mouse over the character, does it change its texture?
image

So if the mouse doesn’t change texture it’s mean that it doesn’t detect the “PlayerChallengeHitbox”.and if the mouse cannot detect the “PlayerChallengeHitbox” it means that the character’s part is hiding it.

Could you check everything I said, and come back with answers thanks!