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

RenderStepped very laggy all of a sudden?

Asked by 3 years ago

I have made 3dmg from the anime Attack on Titan and it has been working great for a few days.

All of a sudden it just got very laggy and it is almost unplayable at this point.

Any help will be highly appreciated!

This is the code.

local function UpdateGrapples()
    if Keys["e"] then 
        RightDecal.Transparency = 1
        RightDecal2.Transparency = 1
        RightGrapple1.Transparency = 0
        local FirePos = (character.HumanoidRootPart.CFrame*RightFirePosition).p
        RightGrapple1.Size = Vector3.new(1, 1, (FirePos-RightGoal.p).magnitude)
        RightGrapple1.CFrame = CFrame.new(FirePos+(RightGoal.p-FirePos)/2, RightGoal.p)
    end
    if Keys["q"] then
        LeftDecal.Transparency = 1
        LeftDecal2.Transparency = 1
        LeftGrapple1.Transparency = 0
        local FirePos = (character.HumanoidRootPart.CFrame*LeftFirePosition).p
        LeftGrapple1.Size = Vector3.new(1, 1, (FirePos-LeftGoal.p).magnitude)
        LeftGrapple1.CFrame = CFrame.new(FirePos+(LeftGoal.p-FirePos)/2, LeftGoal.p)
    end
end

game:GetService("RunService").RenderStepped:connect(UpdateGrapples)

Keep in mind I haven't changed anything since I made the gear.

0
nvm figured it out ColeRandom -6 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Figured it out, there was a humanoid in the workspace causing everything to slow down.

Ad

Answer this question