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

Moving frame from point A to point B in certain time?

Asked by 8 years ago
Edited 8 years ago

I have frame1 and its Size. X.Offset is 116 pixels, and i also have frame2 and it's Size.X.Offset is 1 pixel, how would i move frame2 from position 0 to 116pixels on X scale and exactly in one second smoothly not just like teleporting from point A to B but smoothly and in 1 second?

for i = 0,116 do Slider.Position = UDim2.new(0,i,0,0) wait() end

I know your'e gonna say wait() has minimum waitTime of about 0,03, and i should use RenderStepped, but how would i implement RenderStepped, just give an example modified code please with the GUI number's so i just know how to calculate this (position) next time on my own,?

Edit:I can't use TweenPosition, because its too slow.

Thanks.

1
have you tried the time argument when tweening? Senor_Chung 210 — 8y
1
Thanks, it worked! mastermarkus 11 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

Your best option is to use the TweenPosition function. That is the wiki article for it. I would recommend reading up on it and messing around with it. I know there isn't any code I gave here, but I want you to learn it on yourself. Hope this helps.

0
The TweenPosition actually worked as you recommended, i didn't know TweenPosition has time paramter i just put EndPosition before, Thanks mastermarkus 11 — 8y
0
No problem. Glad I could help. If the answer helped could you please accept it so that people know this question has been solved? MrLonely1221 701 — 8y
Ad

Answer this question