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

Script for Camera suddenly no longer works?

I have a game where the camera is locked on a certain part in the Workspace. The script worked perfectly fine for my other games, but it just suddenly stops working.

Its now giving me the error of "Start is not a valid member of Model" Line 3.

All the names are spelled correctly and match.

Can anyone help me out with this?

--Local Script in StarterGui

local target = workspace.CamParts.Start
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
local angle = 0
 
while wait() do
    camera.CoordinateFrame = CFrame.new(target.Position, workspace.CamParts.LookAt.Position)  --Start at the position of the part
end

1 comment

0

try using this: local target = workspace.CamParts:WaitForChild("Start"), if you see infinite yield is possible then you certainly misspelled something

1 answer

✓ Accepted answer

Don't index it using .. Instead, use WaitForChild.

local camParts = workspace:WaitForChild("CamParts")
local target = camParts:WaitForChild("Start")
local camera = workspace:WaitForChild("CurrentCamera")

Hope this helps! :)

1 comment

0

Yes It did, thanks!

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