Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I tween a Gui that when you hover over appears?

I've managed to make a gui that when you hover over a door it will make a Gui visible. I don't like the way the Gui just pops into existance so I tried tweening it. Didn't work out too well. This is my attempt at tweening;

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local frame = script.Parent:WaitForChild('FrameGUI')
local toggle = false
local Door = 
--LIST OF IN GAME DOORS--
			game.Workspace.Door1.Door.Clickbox or
			game.Workspace.Door2.Door.Clickbox
--LIST OF IN GAME DOORS--

Mouse.Move:connect(function()
    if Mouse.Target and Mouse.Target == Door then
        Player.PlayerGui.DoorGui.SpecialHoverGui.Visible = true
    elseif Mouse.Target and Mouse.Target ~= Door then
        Player.PlayerGui.DoorGui.SpecialHoverGui.Visible = false
    end
end)


Mouse.Move:connect(function()
 if script.Parent.Visible == false then
  frame:TweenPosition(UDim2.new(0.5,-250,0.5,-200), 'Out', 'Bounce', 1)
  script.Parent.Visible = true
 else
  frame:TweenPosition(UDim2.new(0.5,-250,1.7,-200), 'Out', 'Bounce', 1)
  script.Parent.Visible = true
 end
end)

1 answer

Add another argument, true to the end

frame:TweenPosition(UDim2.new(0.5,-250,0.5,-200), 'Out', 'Bounce', 1, true)

This will make the tween function override any prior ones effecting the gui. So if you hover off the door before the tween finishes it will halt and jump to the latest tween call. try it out.

This discussion is preserved as it was. New answers, comments, and votes are closed.