Decorative timeline for the gui

  1. What do you want to achieve? Keep it simple and clear!

I’m trying to implement a timeline like in videos that shows how much time has passed
image

  1. What is the issue? Include screenshots / videos if possible!

The problem is that on different screens, the mark moves differently, and for example, on a 1920x1080 monitor emulation it moves as it should, but if you put any smartphone, it reaches the edge in 3 minutes

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Honestly, I don’t know where to look for a similar problem or solution, or even how to formulate a query

what I have now is written by an assistant inside roblox studio

I suspect that I need to write code depending on the timer code (it’s written separately)

try to use scale instead of offset if you haven’t and can you show your script ?

the script that moves the marker or the timer?

local marker = script.Parent
local scalee = script.Parent.Parent

local moveAmount = 1 
local moveCount = 0 
local maxMoves = 300

while moveCount < maxMoves do
    local currentPosition = marker.Position
    local newOffset = currentPosition.X.Offset + moveAmount

    if newOffset <= scalee.AbsoluteSize.X then
        marker.Position = UDim2.new(currentPosition.X.Scale, newOffset, currentPosition.Y.Scale, currentPosition.Y.Offset)
        moveCount = moveCount + 1
    else
        break
    end

    task.wait(1)
end

you’re using offset, use scale (you can use UDim2.fromScale)

I’m not sure I fully understood what to do, but now the marker is a worm (it stops at some point, then it stretches out a little bit and keeps going)

local marker = script.Parent
local scalee = script.Parent.Parent

local moveAmount = 1 / 300  
local moveCount = 0
local maxMoves = 300  

while moveCount < maxMoves do
	local currentPosition = marker.Position
	local newScaleX = currentPosition.X.Scale + moveAmount

	if newScaleX <= scalee.AbsoluteSize.X then  
		marker.Position = UDim2.fromScale(newScaleX, currentPosition.Y.Scale)
		moveCount = moveCount + 1
	else
		break
	end

	task.wait(1)
end