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

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

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.

2 comments

1

have you tried the time argument when tweening?

1

Thanks, it worked!

1 answer

✓ Accepted answer

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.

2 comments

0

The TweenPosition actually worked as you recommended, i didn't know TweenPosition has time paramter i just put EndPosition before, Thanks

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?

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