So, I started working on a Character Customization system for my project and I’ve found a little problem.
I’ve got a part which got a ClickDetector inside of it. ClickDetector’s MaxActivationDistance is set to 70.
Yeah I would go with voidage, and use Mouse.Target and probably use the part in front to get the item of currently being hovered/clicked. Or go with the model and saying this with no extra parents and get the name of the model clicked.
The wiki doesn’t show a .Target after using the :GetMouse(), but I’m sure it’s there
Ex
local mouse = game: GetService(“Players”).LocalPlayer:GetMouse()
Mouse.Button1Down:Connect:function()
if not Mouse.Target then return end
print(Mouse.Target.Name)
end)
No, the ClickDetector won’t work if they are behind invisible parts. That is why I have been working around it by sizing up the “hitbox” of the part.
You could try an alternative solution such as this, just like the posts above. When the mouse hovers over the object, Mouse.Target returns a BasePart(or an object in the 3D space). However, when the mouse points at the sky, it’ll return nil.
Also try this for ignoring certain models or obstruction when the mouse hovers over them, if you want it to be clicked even with obstruction.
Other than the solutions mentioned above; you can consider removing the transparent parts locally, if they are only needed server-sided. However this is more of a work-around than a solution.