Camera Module help?

I’m trying to edit the CameraModule to simplify the code to do what I need it to do, which is follow the character with a specific rotation and offset, however I cannot seem to figure out why the Module’s :Update() function isn’t firing every frame, despite the rest of the code working as expected. Code and file is provided below

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Utilities = require(ReplicatedStorage:WaitForChild("Utilities"))

local Camera = game.Workspace.CurrentCamera
local CameraOffset =,0, 10)
local CameraRotation =, 0, 0)

local Character

local CameraModule = {}
CameraModule.__index = CameraModule

	local self = setmetatable({},CameraModule)
	self.CharacterAdded = Utilities.CreateNewEvent("CharacterAdded") -- Instance
		Character = NewCharacter
		print(NewCharacter, typeof(NewCharacter))
	return self

function CameraModule:Update(TimeElapsed)
	print(1, TimeElapsed)
	if Character and Character.HumanoidRootPart ~= nil then
		local HumanoidRootPart = Character.HumanoidRootPart
		local CF = + CameraOffset)
		CF = CF * CameraRotation
		Camera.CFrame = Camera.CFrame:Lerp(CF, TimeElapsed)


TPS.rbxl (261.7 KB)

Looking through the default CameraModule class, it looks like you deleted the BindToRenderStep in the function.
RunService:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(dt) self:Update(dt) end) to your .new() function

Side note: Your CameraRotation variable is a Vector3, but I think you intended it to be a CFrame. In your Update() function you perform

CF = CF * CameraRotation -- Multiplying a CF by a Vec3 returns a Vec3
Camera.CFrame = Camera.CFrame:Lerp(CF, TimeElapsed) -- Error: Unable to cast Vector3 to CoordinateFrame
1 Like