Menu Camera working in Studios but not in the game itself

I want to get my camera working in game

My camera for the menu of my game works in roblox studio but not the game itself** Include screenshots / videos if possible!

I’ve tried looking at many forums and youtube videos to fix it but they didn’t help

This is the code


-- wait(0.1)

local RunService = game:GetService("RunService")

local Part = game.Workspace.CamFront

local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable

local Rotation = 0

RunService.Heartbeat:Connect(function()
	local CF = Part.CFrame * CFrame.Angles(0, math.rad(Rotation), 0)
	CF = CF * CFrame.new(0, 0, -10)
	CF = CFrame.lookAt(CF.p, Part.Position)
	Camera.CFrame = CF

	Rotation += 0
end)

This is the error i get when i join the game

2 Likes

Trying doing

local Part = game.Workspace:WaitForChild("CamFront")

instead?

1 Like

Thank you this helps me out a lot

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.