Intro script doesn't always work and I need help

So I have this intro script that when you press play, if you haven’t done the test (the charcter creation) it will just clear the screen, but if you haven’t done the test, it will take you TO the test. but sometimes the intro never loads the camera properly, and only shows the gui, but the way my character creation is set up, (with a part and screengui’s) it never lets the player get to the creation part. and messes up the experience for my whole game. Any help heres the camera part of the script.

wait(0.1)

--// Client

local Player = game.Players.LocalPlayer

local Character = Player.Character or Player.CharacterAdded:Wait()

local Camera = game.Workspace.CurrentCamera

game.Lighting.Blur.Size = 15

--// GUIs

local PlayButton = script.Parent.PLAY

--// Main

Camera.CameraType = Enum.CameraType.Scriptable

repeat wait() until script.Parent.Parent == game.Players.LocalPlayer:WaitForChild("PlayerGui")

repeat wait()

Camera.CFrame = game.Workspace:WaitForChild("CameraPart").CFrame

until Camera.CFrame == game.Workspace:WaitForChild("CameraPart").CFrame

Camera.CFrame = game.Workspace:WaitForChild("CameraPart").CFrame
3 Likes

When you say main, is that a server or a local script?

1 Like

All of that is local script. char30

1 Like

It doesn’t look like you changed the camera’s subject from Character.Humanoid. When your camera’s subject is the character’s humanoid, the camera will revert back to the player after each time you try to change its CFrame.

Im confused. character30limitt

After

Camera.CameraType = Enum.CameraType.Scriptable

Try adding

Camera.CameraSubject = workspace:WaitForChild("CameraPart")
1 Like

I will test this right now. :slight_smile:

It works, but what about when im trying to stop it?

If you want to reset the camera to its original state, you’d basically just do everything in reverse:

Camera.CameraSubject = Character.Humanoid
Camera.CameraType = Enum.CameraType.Custom

I’m not 100% sure that Enum.CameraType.Custom is the default camera type for players, but you should be able to figure that out by testing it out in Studio.

3 Likes

It didnt work with the humanoid thing :confused:

Fixing the camera? Try flipping the lines so that you change CameraType before CameraSubject

For resetting it, try using the player’s current character (might have changed?)

Camera.CameraSubject = game.Players.LocalPlayer.Character
Camera.CameraType = Enum.CameraType.Custom