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?
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