I want to add a SelectionBox to any part the mouse hovers over, and to destroy it once the mouse leaves. I'm unsure how to do this at all, I originally was using UserInputService and raycasting to get the part hovered onto from the camera but the problem with this method was it created a lot of lag since I had to run the function every mouse movement, and I don't know how to detect when the mouse leaves the part.
Is there any simple function I can do this from the mouse? I have many parts so I can't add in like a click detector into every part, was hoping I could do this from just telling the mouse to add a SelectionBox on the part it hovers over, and tells me when it leaves the part. Thanks!

1 comment
I feel so silly for not doing this. Thank you!