How can I change the color when I hover over an item?

In Bloxburg, if you switch to delete mode, you can start deleting things. When you hover over items, the turn red. When you hover over another item, the color becomes normal. I’ve tried searching for MouseEnter and all that stuff but that only works on Gui. I also tried repeat changing the color until the Mouse.Target changes.
But nothing works. Is there any way I can make this possible? Also do I have to save the colors before I change the color? Thanks!

1 Like

Do you want this to happen locally (client) or on the server (everyone)?

1 Like

I want this to happen locally as it is a delete tool for my grid placement system. After the client decides to delete it, it uses InvokeServer to tell the server to delete it.

You can use selection boxes which have a surface color property to turn the entire part a certain color (overlaying it with another color).

You can set up hover events in the 3D world by using mouse move, mouse target, filter if needed, etc.

Check out the tutorial on the dev hub below:

1 Like

Is it possible to make the Adornee a model? Or do I have to add it to each part of the model?

Use the function mouse hover. 30 chars

MouseEnter and MouseLeave are members of GuiObject

// Events of Class GuiObject
Vector2 MouseEnter(int x, int y);
Vector2 MouseLeave(int x, int y);
Vector2 MouseMoved(int x, int y);
1 Like

You could use

local Mouse = Player:GetMouse()


and always have a part where the mouse is hovering using

Part.Position = Mouse.Hit.Position

and then just detect when that part touches the part that you want to change the color of.

idk, but this should work