# Equation need to keep constant speed over timeline spline (regardless of spline length)

Heyo!
So I am making a sprite follow a terrain 2d spline. The spline can be various lengths based on the level design. Being that timelines are distance covered based on time allotted, how can I make it so that no matter how long the spline is the object moving along the spline will always move at a set speed? I am sure there is an equation for it but I cant find one. Thanks in advance.

set the timeline to run 0-1. multiply timeline value by the spline length.

Thanks for the reply! The method you suggest is what I am currently doing (as seen in the screen shot). However, that makes it so the object moving along the spline will move at a velocity based on the distance it needs to move over a set time. What I am wanting to do is have the object always move at a constant X velocity no matter how long that spline is. Meaning if my spline length is 1000 units, the object moves at 10 units per second. If the spline is 50 units in length then the object moves at 10 units per second. Would I have to modify the time in the timeline based on the objects variable speed, or can I still manipulate the objects speed even though the timeline length is set to 10 seconds?

This is exactly what I was looking for. Thanks a ton, man!

ah, once you add a timeline a variable for it is automatically created if you drag a line off the variable you have an option to set the play rate.

i guess dividing the rate by the length works too. for some reason I was thinking multiplying should be separate and took the screen shot before testing without it.