Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a part that has a glowing selection part when you hover over it?

Asked by
iuclds 720 Moderation Voter
4 years ago
Edited 4 years ago

I want it to be like a MouseEnter type of thing then mouse leave

0
Hi Eternalove_fan32 188 — 4y
0
lol Eternalove_fan32 188 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

You can put a ClickDetector in the part. Change the CursorIcon property in the ClickDetector invisible/transparent. Then put a script in the ClickDetector. Use the MouseHoverEnter:() function in your script. Then put a SelectionBox in your part, and make the transparency of the SelectionBox 1. Then, in the script make it so once MouseHoverEnter:(), SelectionBox.Transparency = 0. Lastly, in the script make it so once MouseHoverLeave:(), SelectionBox.Transparency =1.

Your script should look like this:

script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
    script.Parent.SelectionBox.Transparency = 0
end)

script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
    script.Parent.SelectionBox.Transparency = 1
end)
Ad
Log in to vote
0
Answered by
Nowaha 459 Moderation Voter
4 years ago
Edited 4 years ago

You can use the SelectionBox object. You can either add it through code or put it in and enable/disable it when needed.

Make sure to set the Adornee to the Model or Part that should be outlined, otherwise nothing will appear.

Answer this question