How would i do something like this?

Sorry for the vague title, not sure what this is called or whatever

But basically trying to do something like when i hover over a gui, it increases in size and nudges the other guis a little out of the way and not hovering over it would return it to normal

2 Likes

Use MouseEnter and MouseLeave functions

Alright, although how would i have it increase in size & nudge the others over?

Use MouseEnter and then use Tween Service to increase the ui’s size and then use MouseLeave and then use Tween Service again to decrease the size of the ui

Firstly set the anchor point to .5,.5 (for the text label or whatever your doing the code for)
now we’re gonna use the MouseEnter and MouseLeave events + TweenSize() fucntion
And make a local variable with this code innit :

local gui = script.Parent -- sets a variable for the parent (the thing you want the effect on)
local deb = false -- debounce
gui.MouseEnter:Connect(function()
	if not deb then -- to not cause trouble with the code
		deb = true
		gui:TweenSize(UDim2.new(new size), "Out", "Sine", .1 , true) -- makes it bounce when the mouse hovers on it
		deb = false
	end
end)
gui.MouseLeave:Connect(function()
	if not deb then
		deb = true
		gui:TweenSize(UDim2.new(old size), "In", "Sine", .1 , true) -- makes it go back to how it was when the mouse stops hovering.
		deb = false
	end
end)

ps: this local script must be inside the whatever you wanna do the effect on.

For the input, MouseEnter and MouseLeave. For the nudge,

  1. Check if each of the buttons is to the left or to the right of the button, comparing their Position.Scale.X
  2. Move each button to the side they are in. You can calculate the amount by doing (newSize.Scale.X - oldSize.Scale.X) / 2. Then you just add or substract the value depending on the size

you can also do it with Position.Offset.X, it just depends on what you are using

Sorry for the late response, but

Theres no Scale i can call?
if i do try to get it, it just errors

(Edit)
Nvm found out why,
Needa call it by Position.X.Scale

oh yeah, I it’s X first and then Scale. My bad