Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Button Tweening issues with mouse leave and mouse enter, help?

Asked by 4 years ago
Edited 4 years ago

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:

01Settings = script.Parent
02 
03Settings.MouseEnter:Connect(function()
04    print("Mouse Entered")
05    Settings:TweenPosition(UDim2.new(0.143, 0,0.48, 0, "Out", "Quad", 0.2, true))
06end)
07 
08Settings.MouseLeave:Connect(function()
09    print("Mouse Left")
10    Settings:TweenPosition(UDim2.new(0.143, 0, 0.5, 0, "In", "Quad", 0.2, true))
11end)

1 answer

Log in to vote
0
Answered by 4 years ago

You are forgetting to properly use TweenPosition. You aren't including all of the )'s

01Settings = script.Parent
02 
03Settings.MouseEnter:Connect(function()
04    print("Mouse Entered")
05    Settings:TweenPosition(UDim2.new(0.143, 0,0.48, 0), "Out", "Quad", 0.2, true)
06end)
07 
08Settings.MouseLeave:Connect(function()
09    print("Mouse Left")
10    Settings:TweenPosition(UDim2.new(0.143, 0, 0.5, 0), "In", "Quad", 0.2, true)
11end)
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.
14TweenPosition(
15EndPosition, -- Where the gui needs to be
View all 22 lines...
0
Thanks so much I have been stuck for so long EmeraldRailYT 8 — 4y
Ad

Answer this question