#Camera set not working
28 messages · Page 1 of 1 (latest)
Heres the script:
local part = game.Workspace.MenuCamera
local players = game:GetService("Players")
local function setCamera(player)
local camera = game.Workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = part
end
players.PlayerAdded:Connect(setCamera)
local plr = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = part
what about the playeradded thing
The issue here is that when you already joined, the players.PlayerAdded:Connect(setCamera) won't start for you, instead for another player and I dont think you can move the camera for another player like that... actually... maybe
i think you should use camera.Cframe instead of Subject since you are trieng to change the cameras Cframe.
for example:
camera.Cframe = part.Cframe
ok
in this code you are saying that camera.CameraSubject = part
like you say local something = something
you shouldn't do that
try setting the Cframe and tell me if it doesnt work
it didnt
can i see the error?
14:30:21.600 Argument 1 missing or nil - Server - Script:6
the new script
local part = game.Workspace.MenuCamera
local players = game:GetService("Players")
local camera = game.Workspace.CurrentCamera
players.PlayerAdded:Connect(function()
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = part
end)
** You are now Level 5! **
is this the code where you are getting the error Argument 1 missing or nil
or was it the previouse script
where you added cframe
let me test the new one
you have the Code inside a local script or server script?