In a game im helping create I created a hitbox which attaches to player torso, within the hitbox there is a click detector. However when I run the game the clickdetector doesn’t seem to be active(Clicks don’t work and the cursor doesn’t change appearance)
I’ve tested it through and it appears the Clickdetector doesn’t work when it is welded to the player.
Your game is R6 correct? If your game is not R6 then players (that are R15) will not have a torso, but rather a Upper and Lower Torso, and a HumanoidRootPart!
Um, where here is the Click Detector? I am very confused. Could you provide us with more details? Also, have you tried making a print statement for the detector to see if it actually works or not? I recommend you put a print statement in the first line of the detection function and see if it prints.
That is different. Make the hitbox bigger than the character. It could be that something else is clipping it so it doesn’t display it. Also, make sure the distance is large enough.
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
local model = mouse.Target:FindFirstAncestorOfClass('Model')
if model then
local playerClicked = game.Players:GetPlayerFromCharacter(model)
if playerClicked then
print(playerClicked.Name)
end
end
end)