Hello fellow developers, I’ve been trying to create a game and for the play screen I wanted the camera to be focused on something the instant they join. When I use Wait (5)
it works but obviously thats not the exact time I join so theres still some time before it focuses on the part.
This is the script with the wait:
wait(5)
local cam = workspace.CurrentCamera
local part = workspace.Part
cam.CameraType = Enum.CameraType.Fixed
cam.Focus = part.CFrame
Heres the script with PlayerAdded:
game.Players.PlayerAdded:Connect(function()
local cam = workspace.CurrentCamera
local part = workspace.Part
cam.CameraType = Enum.CameraType.Fixed
cam.Focus = part.CFrame
end)
These are local scripts in StarterPlayerScripts btw if that has anything to do with it, in a summary I want every player when they join for their camera to be locked on a part like instantly, any help is appreciated, thank you and have a great day!