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
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
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)
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
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