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

[SOLVED] Why is simple TweenPosition not working? [NO ERRORS PRINTED]

I tried running that code:

script.Parent.MouseButton1Click:Connect(function()
	local x = script.Parent.Parent.Position.X
	
	script.Parent.Parent:TweenPosition(UDim2.new(x,0,.2,0),'Out','Quart',1)
end)

(yes, the frame selected (line 2) is active and all its components) but it dosen't work? It just doesn't play, got any ideas?

Explorer: http://prntscr.com/rbqts3

7 comments

0

-200 too much of a number for the first y value, as it will match the screen in any size. So, the position should be from -2 to 2 if you want it on screen or not.

0

The result in this, is it's tweening to position to -200 in 1 second. That's really fast, try putting the number between -2 and 2.

0

Dosen't work...

0

And @killerbrenden also, dosen't work.. I changed it to .2

0

I changed the position to .2

0

Can you show us a picture of how you setup your gui (a hierarchy)?

0

Sure look at edit!

1 answer

✓ Accepted answer

It won't move because it's setting the position of X that it's already at. So if X = 0.5, then it will tween to 0.5, where it's already at. You have to manually put in the value you want it to tween to.

2 comments

0

Thanks!

0

No problem!

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