How to make my gui less laggy

my ui makes lag, i think its probably due to how many lines are there, but i need all the lines or else there’s gonna be a gap

Do you mind showing the code (if there is any) so I may be able to help?

Instead of using tons of UI frames, try using a single ImageLabel with the ScaleType set to Tile.

To replicate the animation, scale the ImageLabel in the direction of animation multiplied by the UDim2 TileSize, and to get it to move just offset the ImageLabel with the direction and speed you want while resetting each axis respectfully once it’s passed the TileSize UDim2.

EXAMPLE

local HoldingFrame = script.Parent.Parent --SCREENGUI

local ImageLabel = script.Parent

local TileSize = ImageLabel.TileSize

local Speed = 60 --PIXELS PER SECOND

local Direction = Vector2.new(1,-5).Unit

local function ConvVec2(ud,viewport)

return Vector2.new(ud.X.Offset+(ud.X.Scale*viewport.X),ud.Y.Offset+(ud.Y.Scale*viewport.Y))

end

local RawTileSize = ConvVec2(TileSize,HoldingFrame.AbsoluteSize)

HoldingFrame.Changed:Connect(function(nv)

if nv == 'AbsoluteSize' then

RawTileSize = ConvVec2(HoldingFrame.AbsoluteSize)

end

end)

ImageLabel.Size += TileSize

ImageLabel.TileSize -= UDim2.new(TileSize.X.Scale^2,0,TileSize.Y.Scale^2,0)

local TimePosition = 0

game:GetService('RunService').RenderStepped:connect(function(DeltaTime)

TimePosition+=DeltaTime

local RawPosition = Direction*(Speed*TimePosition)

ImageLabel.Position = UDim2.new(0,RawPosition.X - math.ceil(RawPosition.X/RawTileSize.X)*RawTileSize.X,0,RawPosition.Y - math.ceil(RawPosition.Y/RawTileSize.Y)*RawTileSize.Y)

end)
3 Likes

here’s the code
local TS = game:GetService(“TweenService”)

local TI = TweenInfo.new(10,Enum.EasingStyle.Linear)

local Frame = script.Parent

while true do

Frame.Position = UDim2.fromScale(.5,0)

local Tween = TS:Create(Frame,TI,{Position = UDim2.fromScale(.5,1)})

Tween:Play()

Tween.Completed:Wait()

end

Im thinking about the while true do, make the wait 11 seconds and see if that works
then do Tween:Destroy()

i bet its probably the amount of the ui frames inside the thing cuz there’s like about 500 of them

I am not that good for code, but I think if you want to make a GUI the lees laggy
is use the Left number in position and size, for example : {0.1,0} {0.1,0}.
and dont use the right number alot or use a plugin.