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

Smooth Scriptable Camera Movements? [Solved]

Asked by 10 years ago

I'm trying to improve the steering portions of an old plane tool of mine and have started to use the Scriptable setting to lock the camera behind the plane and tilt as the plane does, making it feel vastly more realistic. However, I have to constantly update the camera to the new position of the plane as it moves with a while loop, which you can already guess makes the image of the plane shake violently once it speeds up. Are there any smooth ways to keep the camera locked to a certain distance from a part?

0
You can script the target of the camera to a certain part of the plane, but I don't know about the tilt/roll of the camera OniiCh_n 410 — 10y
0
Target? that isn't a property that I see... deaththerapy 60 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

It shakes violently because wait() waits 1/30th of a second, and that isn't fast enough for fast camera movements. You want to use RenderStepped for that because it waits 1/60th of a second. Like this:

local RS = game:GetService("RunService")
while true do
    --Put your code here
    RS.RenderStepped:wait() --This waits 1/60th of a second, which is twice as fast as wait()!
end

Note: For more information on RunService, click here: RunService

0
Sweet, that worked wonders. Thanks! deaththerapy 60 — 10y
Ad

Answer this question