How do you get a GUI tween to stay the same speed no matter the distance

Currently I’m making a ‘powerblinds system’, this is basically a scrolling image label that goes to a certain position via tweening (on a surface GUI) depending on what destination you select

The current issue is that it goes really slow when it needs to go to the shorter position, but really fast when it needs to go a further distance.

I’ve tried looking for topics about this on the devforum, couldn’t find anything so here I am, I’ve also tried dividing the distance between the destination it’s coming from and the destinations it’s going to but that isn’t working too well

Just looking for a bit of guidance of what I should try, not asking for code

2 Likes

To keep the velocity constant you can apply the equation of uniform motion (v=d/t) by solving for the time t=d/v. Then you must calculate the time from the distance your ImageLabel will move.

2 Likes

Enum.EasingStyle.Linear

Its name should indicate as to why.

This won’t work, i’m asking for the speed to stay the same no matter the distance, so for example a car is moving towards a part far away in 5 seconds, it will move fast. Another car is moving towards a part close to it in 5 seconds, it will move slower.

Something which is tweened linearly maintains a constant speed.

Tweening requires a certain time it should complete it by, linear will keep at a constant speed and complete it by the time your providing, what I’m asking is a formula to calculate the speed for the time it should complete it by which has been solved earlier

You should have titled your thread differently then.

What you’re asking for is how to work out time when you have speed and distance.

Which is a simple equation.

s = d/t then rearrange for t t = d/s.