camerascript.lua (234 Bytes)
Hi! I wrote this camera script, and nothiing happened, the camera was normal, whats wrong with it? I put it in ServerScriptService btw. I’d really appreciate if you explain it, rather than just dumping code onto here. Thanks
local Camera = workspace.CurrentCamera
Camera:GetRenderCFrame()
local pos = Vector3.new(1,10,1)
local lookAt = Vector3.new(1,1,2)
local cameraCFrame = CFrame.new(pos, lookAt)
Camera.CFrame = cameraCFrame
Camera.HeadLocked = true
A camera should only be manipulated from a local script. Because each player has his own camera object, that’s different from another player’s camera. It might seem like all workspaves have a single Camera object, but no each local workspace for each local player has a seperate table.
ServerScriptService is a place for server scripts, only server scripts are supposed to run their.
I assume you used a server script, so change it to a local script and put it inside of StarterGui, you might actually be using a local script, but it’s in serverscriptservice, where it wouldn’t run, so switch to StarteeGui (another possibility might be StarterPlayerScripts)
Did you switch to a local script?
Also you seem to be requiring Camera:GetRenderCFrame() without setting it to a variable, which is uselss. You’re also not using it. Do
Camera Manipulation
As the camera is part of the client and isn’t replicated, it must be manipulated in a LocalScript in a client area (i.e StarterPlayerScripts or PlayerScripts).