I’m trying to make a menu camera, but it will not work and only “ok” prints. I also get this error: ServerScriptService.Script:6: invalid argument #1 to 'new' (Vector3 expected, got CFrame)
Here is the full script
local CurrentCamera = game.Workspace.CurrentCamera
local CameraPart = game.Workspace.Scene1Menu.CameraPart
game.Players.PlayerAdded:Connect(function(plr)
print("ok")
CurrentCamera.CFrame = CFrame.new(CameraPart.CFrame) -- Where the error is
print("yay")
end)
In that script you are creating a new cframe and setting its position to the CFrame. A CFrame is not a vector 3.
You should do “CameraPart.Position” instead of “CameraPart.CFrame”.
The CurrentCamera does not have a “personal” position property, it only has a CFrame one that contains a position. To set the position and -or angle of the Camera, you should use CFrames which is the acceptable property of the CurrentCamera.
To create a new CFrame, the first parameter is always going to be a Vector3 value aka a position.
In-case you want the camera to replicate the position and angles of the part, you should do this instead: