Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script for Camera suddenly no longer works?

Asked by
BloxRoxe 109
5 years ago

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
0
try using this: local target = workspace.CamParts:WaitForChild("Start"), if you see infinite yield is possible then you certainly misspelled something g1o2r3d4a5n6 350 — 5y

1 answer

Log in to vote
1
Answered by
chomboghai 2044 Moderation Voter Community Moderator
5 years ago

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! :)

0
Yes It did, thanks! BloxRoxe 109 — 5y
Ad

Answer this question