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

Why does it jitter?

Asked by 8 years ago

So I have a script that focuses to the torso of a model but when that model moves it is very jittery when following it. How do I make it smooth?

script.Parent.MouseButton1Down:connect(function()
    script.Parent.Visible = false
    script.Parent.Parent.MiniGuiFolder["<"].Visible = false
    script.Parent.Parent.MiniGuiFolder[">"].Visible = false
    local player = game.Players.LocalPlayer
    wait(0.3)
    game.Workspace[player.Name..'Figure'].Humanoid.Health = 100
    game.Workspace[player.Name..'Figure'].Humanoid.MaxHealth = 100
local target = workspace[player.Name.."Figure"].Torso
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target

while wait() do
    camera.CoordinateFrame = CFrame.new(target.Position)
                           * CFrame.Angles(-95, 0, 0) 
                           * CFrame.new(0, 0, 25)       
end
end)
0
I would use RenderStepped and lerp. They're used to make things smoother, because they are smaller than wait(). RenderStepped is 1/60th of a second, while wait() is 1/30th of a second. Lerp makes the movents "smaller" so to speak. SimplyRekt 413 — 8y
0
Can you show me how to incorporate that? is it while RenderStepped or Lerp 2sp00ky4y0u 2 — 8y

Answer this question