In todays video I show you how to add Hover effects into your gui inside of Roblox Studio. Hover effects are a great thing to have in your game as it adds that extra bit of smoothness to the game. Hover Effects are often used to confirm with the user what they are clicking on before they do it. These hover effects are used alot more than you may think, these are used in a majority of popular Roblox games! In todays video we go over 5 different types of hover effects that you can add to your very own Roblox game. Yes... This video is over 30 minutes long, but trust me you will understand why when you begin watching! So if you did want this type of feature in your game make sure to watch to the end of the video to find out how!
I really enjoy making these videos for you all so I hope you enjoy them just as much as I do!
Have a lovely rest of your day!
Script 1 (Basic, Size up)
local Gui = script.Parent
local OriginalSize = Gui.Size
local ScaleFactor = 1.1 -- You are able to change how much it is scaled by here
local function ScaleUp()
local NewSize = UDim2.new(OriginalSize.X.Scale, OriginalSize.X.Offset * ScaleFactor, OriginalSize.Y.Scale, OriginalSize.Y.Offset * ScaleFactor)
Gui.Size = NewSize
end
local function ResetSize()
Gui.Size = OriginalSize
end
Gui.MouseEnter:Connect(ScaleUp)
Gui.MouseLeave:Connect(ResetSize)
----------------------------------
Script 2 (Smooth, Animation Size Up)
local Gui = script.Parent
local OriginalSize = Gui.Size
local ScaleFactor = 1.1
local TweenTime = 0.1
local function ScaleUp()
local NewSize = UDim2.new(OriginalSize.X.Scale, OriginalSize.X.Offset * ScaleFactor, OriginalSize.Y.Scale, OriginalSize.Y.Offset * ScaleFactor)
game:GetService("TweenService"):Create(Gui, TweenInfo.new(TweenTime), {Size = NewSize}):Play()
end
local function ScaleDown()
game:GetService("TweenService"):Create(Gui, TweenInfo.new(TweenTime), {Size = OriginalSize}):Play()
end
Gui.MouseEnter:Connect(ScaleUp)
Gui.MouseLeave:Connect(ScaleDown)
-----------------------------------
Script 3 (Adding the line of code for color of the gui)
Gui.BackgroundColor3 = Color3.new(0.333333, 1, 0)
----------------------------------
Script 4 (Only changing gui color)
local Gui = script.Parent
local function ChangeUp()
Gui.BackgroundColor3 = Color3.new(0.333333, 1, 0) -- Change to the color you want the GUI background to be when the button is hovered over.
end
local function ChangeDown()
Gui.BackgroundColor3 = Color3.new(1, 1, 1) -- Change back to the original color you set in Roblox Studio.
end
Gui.MouseEnter:Connect(ChangeUp)
Gui.MouseLeave:Connect(ChangeDown)
----------------------------
Script 5 (Sound plays)
local Gui = script.Parent
local Sound = game.SoundService.SoundEffect
local ExitSound = game.SoundService.SoundEffectLeave
local function ChangeUp()
Sound:Play()
end
local function ChangeDown()
ExitSound:Play()
end
Gui.MouseEnter:Connect(ChangeUp)
Gui.MouseLeave:Connect(ChangeDown)
---------------------
If you are a bit confused what to do, Feel free to create a ticket in my discord server and we can help you out!
NEW! Floppys Obby Game: www.roblox.com/games/14917960...
Floppys Simulator Game: www.roblox.com/games/13963457...
FloppyFish Merch Store: itz-floppyfish.creator-spring...
If you would like to support me even more, Super Thanks and becoming a Member is also another way to show your appreciation!
🌟 Floppys Discord Server: / discord
Roblox Studio Tutorial
Roblox Studio
Studio Tutorials
Негізгі бет Ойындар How to add HOVER EFFECTS | Roblox Studio
Пікірлер: 63