Camera choppy when tweening it

Hello!

I have a camera that tweens, however it’s a bit choppy, is there a way to get around it, or is it due to the screen blur effect?

TIA for any help!

Example of what’s going on:

Script:

game.Players.LocalPlayer.CharacterAdded:Wait()
local cc = workspace.CurrentCamera

cc.CameraType = Enum.CameraType.Scriptable
cc.CFrame = CFrame.new(-0.1, 30, 5)

local blur = cc:FindFirstChildOfClass('BlurEffect')
if blur then blur:Destroy() end

blur = Instance.new('BlurEffect', cc)
blur.Size = 12

game.Players.LocalPlayer.CameraMaxZoomDistance = 50

local TS = game:GetService('TweenService')
if script.Parent.PlayClicked.Value == false then
	while true do
		local tween = TS:Create(cc, TweenInfo.new(.1, Enum.EasingStyle.Linear), {CFrame = cc.CFrame * CFrame.Angles(0, math.rad(1), 0)})
		tween:Play()
		tween.Completed:Wait()
		if script.Parent.PlayClicked.Value == true then
			TS:Create(blur, TweenInfo.new(0.5), {Size = 0}):Play()
			for i,v in pairs(script.Parent:GetDescendants()) do
				if v:IsA('TextLabel') or v:IsA('TextButton') then
					TS:Create(v, TweenInfo.new(0.5), {TextTransparency = 1, BackgroundTransparency = 1}):Play()
				elseif v:IsA('Frame') then
					TS:Create(v, TweenInfo.new(0.5), {BackgroundTransparency = 1}):Play()
				elseif v:IsA('ImageLabel') then
					TS:Create(v, TweenInfo.new(0.5), {BackgroundTransparency = 1, ImageTransparency = 1}):Play()
				end
			end
			cc.CameraType = Enum.CameraType.Custom
			cc.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
			wait(0.5)
			for i,v in pairs(script.Parent:GetDescendants()) do
				if v:IsA('GuiObject') then
					v.Visible = false
				end
			end
			for i,v in pairs(script.Parent.Parent:GetChildren()) do
				if v ~= script.Parent and v:IsA('ScreenGui') then
					v.Enabled = true
				end
			end
			break
		end
	end
end

After that first chop, it looked fine to me. Did the game just load? Maybe you could wait a bit before manipulating the camera.

Another possible issue is that while true loop you have. An alternative option is to manipulate the camera CFrame yourself with RunService.RenderStepped. Be sure to account for the amount of time between each frame.

1 Like

Thanks!

Yeah, the game did just load, but I think it was just my screen recorder. After that, you can see a little bit of choppiness, but I think it might be the blur effect.

I’ll try out RenderStepped and see how that works out, if not then there isn’t much I can do.

Oh, and if you use RenderStepped, don’t use tween service. Change the camera’s CFrame directly.

I did not see choppiness, I just saw flickering colors.

1 Like