Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why Does This Script Not Change The Camera Properties?

local Cam1 = game.Workspace:WaitForChild("Camera1")
local Cam = game.Workspace.CurrentCamera
local Targ = game.Workspace:WaitForChild("Target")

wait(1)
Cam.CameraSubject = Cam1
Cam.CFrame = CFrame.new(Cam1.Position,Targ.Position)
Cam.CameraType = "Scriptable"

So the script which is a normal script is placed in serverscriptservice. Problem is it wont change the camera at all nor if its put in workspace. I know its a simple fix but im not sure what it is. I tried player added function but same result. NOTHING!! Help would be appreciated.

1 answer

✓ Accepted answer

Use a Local Script.

Regular script can't access Current Camera. I would also suggest setting the CameraType before setting it's CFrame.

Example,

-- Local Script in StarterPack or something
local Cam1 = game.Workspace:WaitForChild("Camera1")
local Cam = game.Workspace.CurrentCamera
local Targ = game.Workspace:WaitForChild("Target")

wait(1)
Cam.CameraType = "Scriptable"
Cam.CameraSubject = Cam1
Cam.CFrame = CFrame.new(Cam1.Position,Targ.Position)

Let me know if that works for you.

Good Luck!

This discussion is preserved as it was. New answers, comments, and votes are closed.