What do you want to achieve? I’m trying to make a game menu where the i set the CFrame of the camera to a part.
What is the issue? The error in the screenshot is displayed.
What solutions have you tried so far? I have been looking for solutions yet unable to find one.
The code is placed inside a gui object in StarterGui.
local campart = workspace.CameraPart
local camera = workspace.CurrentCamera
repeat wait()
camera = Enum.CameraType.Scriptable
until camera == Enum.CameraType.Scriptable
camera.CFrame = campart.CFrame
I am genuinely confused since it appears to work in other games.
local campart = workspace:WaitForChild("CameraPart")
local camera = workspace.CurrentCamera
camera.CameraType= Enum.CameraType.Scriptable
camera.CFrame = campart.CFrame