Problems with Camera.CFrame

So, I’m having a bit of trouble with the camera. I’ve edited a nice cannon that makes the CurrentCamera scriptable, then makes the Camera’s CFrame with a part. The problem is, it makes it lag whenever I turn and move the cannon, as you can see here:

I used this code to keep the camera’s CFrame:

repeat
	cam.CFrame = server.Parent.View.CFrame
	wait()
until closed == true

Is there anything I can do to fix this?

Tie the alignment to heartbeat or renderstep instead of a wait() loop. wait() yields and is not guaranteed to run on the every step of execution (depends on what Roblox’s scheduler decides), where as heartbeat/render step have precise guarantees.

1 Like

RunService worked perfectly instead of using wait(), thanks for giving me the idea of it.