Camera not moving

I’m currently trying to make a system for my Backrooms game that easily allows me to film trailers. This is my current code:

local input = script.Parent.Parent
local button = script.Parent
local plr = game.Players.LocalPlayer
local GUI = plr.PlayerGui
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local cam = game.Workspace.CurrentCamera
local musicA = game.Workspace.Level0Music
local musicB = game.Workspace.Blackout

button.MouseButton1Click:Connect(function()
	if input.Text == "0.2" then
		print("Playing 0.2 trailer footage")
		char:WaitForChild("HumanoidRootPart").Anchored = true
		musicA:Stop()
		musicB:Stop()
		cam.CFrame = CFrame.new(Vector3.new(0, 0, 0), Vector3.new(0, 0, 0))
	end
end)

For some reason the camera does not move. Everything else in the script works though.
Edit: After changing some of the CFrame, it seems only the position Vector3 doesn’t work

cam.CameraType = Enum.CameraType.Scriptable
i believe the cameratype has to be scriptable before you can manipulate it with a script

1 Like

Tried that but it still only rotates.

It should look like this:
cam.CFrame = CFrame.new(0,0,0, 0,0,0,0)

the first 3 digits are the position, others are orientation
orientation can be set like this:

cam.CFrame = CFrame.new(0,0,0, 0,Math.rad(90,0,0)

and set camera type to cam.CameraType = Enum.CameraType.Scriptable

Never mind, solved it by using parts for reference.

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