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

let me make a title you stupid website?

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.

3 comments

0

OH CRAP

1

I DIDNT MEAN TO MAKE THAT MY TITLE

0

lol, Just hit edit and you can change it i believe

1 answer

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

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