The classic question. So through out all these years, Roblox had this instance called Click Detectors, we all know it. But, there were lots of issues with them; So I created this module. It uses raycasts for the customclickdetectors.
Demos
Examples
Hello world.
local myClickDetector = customClickDetector.new({
instance = workspace.Part
})
myClickDetector.mouseDown:Connect(function()
print("Hello world")
end) -- event which when mouse is clicked, the function fires
customClickDetector.startLoop() -- starts the loop which handles the click detectors
Yes but its not documented yet. In the class add a hoverIcon key with the decal id.
note you can also add an unhoverIcon key to put the unhover icon decal id.
i just noticed the documentation has very little info.
But for now, all the table arguments are this:
instance = initialProps.instance,
maxDistance = initialProps.maxDistance or 32,
hoverIcon = initialProps.hoverIcon or "",
unhoverIcon = initialProps.unhoverIcon or ""
So for a custom hover icon example, do this:
local myClickDetector = customClickDetector.new({
instance = workspace.Part,
hoverIcon = "rbxassetid://id"
})
myClickDetector.mouseDown:Connect(function()
print("Hello world")
end) -- event which when mouse is clicked, the function fires
customClickDetector.startLoop() -- starts the loop which handles the click detectors