Camera manipulation issue

i want the camera to focus on one object but its gives the error that i did not select a camera module, it would be nice if someone could help me with this.

script
local cam = game.Workspace.CurrentCamera

cam.CameraType = Enum.CameraType.Scriptable

print(cam.CameraType)

for i, v in pairs(workspace.Items:GetChildren()) do
    cam:Interpolate(workspace.Cam.CFrame,v.CFrame,.01)
end

local plr = game.Players.LocalPlayer
local char = plr.Character  or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")

char:WaitForChild("HumanoidRootPart").Anchored = true

hum.WalkSpeed = 0
error

image

1 Like

Ah yes the darn camera module warning

This is because the script is assuming that there’s already a Camera object, you can just fix this by adding a simple wait() before you set your CameraType property

1 Like