Move sphere between start and end on the line

Hi I draw a line with

Vector2 pos = transform.position;
Gizmos.DrawLine(Vector2.zero, pos);

I want get this line’s vectors as 0-1 so i can draw a sphere and move between start and end on the line with a slider
I draw sphere but i don’t know how can i move it between start and end on the vector

Gizmos.DrawLine(Vector2.zero, pos);

For this you need to use Vector2.Lerp. In this method ‘a’ and ‘b’ parameters are your start and end respectively. ‘t’ is the normalized value you’ll get from a slider.