For example, the code below. If you click your mouse while over the Hitbox, the GUI appears. However, if you are 100 studs away and click the part, the GUI will still appear.
mouse.Button1Down:Connect(function()
if mouse.Target.Name == "Hitbox" then
interactions.Visible = true
else
interactions.Visible = false
end
end)
Is there anyway to limit the distance somehow? As in the GUI will only open if the player is within 5 studs of the object. I know I could use ClickDetectors, but for the task I'm trying to do it really isn't the most efficient option... thanks!
