#trying to make a start screen with a camera, but isnt working?

9 messages · Page 1 of 1 (latest)

sinful bison
#

Focus is not a valid member of workspace (clearly it is). what is wrong with my code?

local camera = wspace.CurrentCamera
local focus = wspace.Focus
local playBtn = script.Parent
local mainFrame = script.Parent.Parent
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

repeat
    wait(.1)
    camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable

camera.CFrame = focus.CFrame

local function onPlay()
    camera.CameraType = Enum.CameraType.Custom
    mainFrame.Visible = false
end
playBtn.Activated:Connect(onPlay)```
#

the LocalScript is the script with this code in.

grim hinge
#

focus has not yet loaded in

#

also a variable for workspace?

#

just use workspace

lucid marten
#

use waitforchild

sinful bison
lucid marten
#

:WaitForChild("Focus")

sinful bison
#

thanks