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

let me make a title you stupid website?

Asked by 2 years ago

So, basically, whenever I try to tween an image button, it tweens to the correct X position, but not the right Y. For some reason it thinks the Y is 0, which is extremley frustrating. A little help? (I tried not using a variable for goal position, it didn't work haha.)

            card.MouseEnter:Connect(function()
                local GOAL_POSITION = UDim2.new(card.Position.Width, 0,0.6, 0)
                card:TweenPosition(GOAL_POSITION,"InOut", "Quint", .1, true)
                print("mouseenter")
                print(GOAL_POSITION) --prints the Y as 0
            end)
            card.MouseLeave:Connect(function()
                local GOAL_POSITION = UDim2.new(card.Position.Width, 0,0.75, 0)
                card:TweenPosition(GOAL_POSITION,"InOut", "Quint", .1, true)
                print("mouseexit")
                print(GOAL_POSITION) --prints the Y as 0.
            end)

Yes, the tween works, it just doesnt work for Y.

0
OH CRAP zaqree512345 3 — 2y
1
I DIDNT MEAN TO MAKE THAT MY TITLE zaqree512345 3 — 2y
0
lol, Just hit edit and you can change it i believe theking66hayday 841 — 2y

1 answer

Log in to vote
1
Answered by
boredlake 256 Moderation Voter
2 years ago

I don't think Position has a Width, just an X and a Y. So, rather than card.Position.Width, do card.Position.X.

Ad

Answer this question