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

My Camera Script Not working due to a wait but I don't know why?

Asked by 3 years ago

Code:

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera

player.CharacterAdded:Wait()
player.Character.WaitForChild("Head")

camera.CameraSubject = player.Character.HumanoidRootPart
camera.CameraType = Enum.CameraType.Attach
camera.FieldOfView = 70


game:GetService(("RunService")).Stepped:Connect(function()
    camera.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position) * CFrame.new(0, 0, 10)
end)

0
do you get any errors in the developer console while play testing? (press F9 to see the console) NGC4637 602 — 3y
0
the errors might sometimes explain why something doesn't work. NGC4637 602 — 3y
0
the error is: Expected ':' not '.' calling member function WaitForChild bcz7_Dev 12 — 3y
0
that means it should be player.Character:WaitForChild("Head"), the script wanted a colon ":" and not a dot "." NGC4637 602 — 3y

Answer this question