Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why Cframing Parts in muliple loops causes lag?

Asked by 5 years ago
local g = workspace.NewPart
local v1 = workspace.BasePart
for i = 1,20 do
        if g:FindFirstChild("Blast"..i-1) then
            g:FindFirstChild("Blast"..i-1).CFrame = CFrame.new(9999,9999,9999)                  end
        g:WaitForChild("Blast"..i).CFrame = v1 * CFrame.Angles(0,math.rad(90),0) + v1.lookVector * 150
wait()end

Running one of this loop is fine but when I run like 10+ my game loop's start to slow down and lag. I thought CFraming was the least expensive but it still lags. Any Help?

0
CFraming is one of the reasons why most games are laggy in my opinion. There is nothing much you can do about it. greatneil80 2647 — 5y

Answer this question