When hovering over a button I want it to move up a couple studs or so and move down when I move my mouse away. I have a working version, but I have to keep my mouse hovering over it the whole time its tweening or else it wont go back down when I leave it. I am unsure what I'm doing wrong, I have override set to true.
Video Example: https://www.youtube.com/watch?v=a2k2n5sDpS8&ab_channel=JustEmerald
Here is my Code:
01 | Settings = script.Parent |
02 |
03 | Settings.MouseEnter:Connect( function () |
04 | print ( "Mouse Entered" ) |
05 | Settings:TweenPosition(UDim 2. new( 0.143 , 0 , 0.48 , 0 , "Out" , "Quad" , 0.2 , true )) |
06 | end ) |
07 |
08 | Settings.MouseLeave:Connect( function () |
09 | print ( "Mouse Left" ) |
10 | Settings:TweenPosition(UDim 2. new( 0.143 , 0 , 0.5 , 0 , "In" , "Quad" , 0.2 , true )) |
11 | end ) |
You are forgetting to properly use TweenPosition. You aren't including all of the )'s
01 | Settings = script.Parent |
02 |
03 | Settings.MouseEnter:Connect( function () |
04 | print ( "Mouse Entered" ) |
05 | Settings:TweenPosition(UDim 2. new( 0.143 , 0 , 0.48 , 0 ), "Out" , "Quad" , 0.2 , true ) |
06 | end ) |
07 |
08 | Settings.MouseLeave:Connect( function () |
09 | print ( "Mouse Left" ) |
10 | Settings:TweenPosition(UDim 2. new( 0.143 , 0 , 0.5 , 0 ), "In" , "Quad" , 0.2 , true ) |
11 | end ) |
12 | -- Any type of value, Vector3, UDim2, CFrame, etc... are all defined within ( and ). You must include these otherwise it tries to pick up incorrect arguements. |
13 | --[[ TweenPosition consists of a few different arguments, and you are only technically giving it one long incorrect arguement. |
14 | TweenPosition( |
15 | EndPosition, -- Where the gui needs to be |