I'm getting into camera manipulation, and with the help of the wiki I made a very simple camera script that tracks an NPC using the BindToRender step function.
local runService = game:GetService("RunService") local player = game.Players.LocalPlayer local camera = game.Workspace.CurrentCamera local cameraSubject = game.Workspace:WaitForChild("NPC") local offset = Vector3.new(20, 5, 20) local function onRenderStep() local subjectPosition = cameraSubject.Torso.Position local cameraPosition = subjectPosition + offset camera.CFrame = CFrame.new(cameraPosition, subjectPosition) end runService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)
When I go into a server, if my player moves this character, I experience no "lag" on my screen and the transition between frames is seamless. However, on my test device the camera seemed to only be updating every few seconds. It worked the same way vice versa. What is this caused by, and how can it be resolved?
You will want to use Interpolate. This will mean that it acts as "tweening" like the gui methods.
I have not needed to use this so I do not have an example to include.
Hope this helps.