So I was working on a game intro and the script is fine, but the camera does not always work. So it shows the character, and it is not supposed to do that. Heres my script
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = game.workspace.CurrentCamera
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
well for 1 you dont need to loop setting the camera type. Try just adding a wait for like 1 second at the top of the script. see if that fixes. Sometimes the game loads too fast or too slow and can cause problems with the script.
Usually ill do this at the top of my local scripts.
repeat wait() until game:IsLoaded() wait(1)
then put the main code below. Usually works fine.
You can try waiting for the Humanoid. That delay might be enough.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local character = player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = humanoid.RootPart
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.Cameras.TitleScreenCamera.CFrame
A simple camera script. This will just set it to the part, won’t do anything fancy. Just put the script in StarterCharacterScripts and it will wait until the character is loaded (meaning the camera should be too)
Explorer
--// Variables
local player = game:GetService("Players").LocalPlayer;
local part = workspace.Part;
local camera = workspace.CurrentCamera;
--// Do
camera.CameraType = Enum.CameraType.Scriptable;
camera.CameraSubject = part;
camera.CFrame = part.CFrame;
Edit: edited the code to add the one whole line of code since @magicalmariomario said my code didn’t work.