So the custom cam works but the UI show up does not and the fade in intro does not work either. Any help?
--//Variables local play = script.Parent.Play local chapter = script.Parent.Chapter local title = script.Parent.Title local fader = script.Parent.Fade local campart = workspace.Cameras:WaitForChild("JoinedCam") while wait(.05) do workspace.Camera.CameraType = "Scriptable" workspace.Camera.CFrame = campart.CFrame end --//Fade fader.Visible = true fader.BackgroundTransparency = .1 wait(.5) fader.BackgroundTransparency = .15 wait(.5) fader.BackgroundTransparency = .2 wait(.5) fader.BackgroundTransparency = .3 wait(.5) fader.BackgroundTransparency = .45 wait(.5) fader.BackgroundTransparency = .7 wait(.5) fader:Destroy() wait(1) title.Visible = true wait(1) chapter.Visible = true wait(1) play.Visible = true play.MouseButton1Click:Connect(function() title.Visible = false chapter.Visible = false play.Visible = false workspace.Camera.CameraType = "Custom" workspace.Cameras.JoinedCam:Destroy() game.Players.LocalPlayer.HumanoidRootPart.CFrame = CFrame.new(-553.1, -35.9, -24)--Spawnpoint end)
the problem is that you're creating a indefinite while loop over the code, which makes it yield the thread for a indefinite amount of time unless you break it or the condition in it turns false which you cant do that since you set the condition of the loop as the wait()
method. also you can just use workspace.CurrentCamera
instead, which is the client's camera and theres no need for a while loop anyways. use a for loop instead of setting the transparency each time or you could use TweenService
for a smoother effect and more options.
--//Variables local play = script.Parent.Play local chapter = script.Parent.Chapter local title = script.Parent.Title local fader = script.Parent.Fade local campart = workspace.Cameras:WaitForChild("JoinedCam") local camera = workspace.CurrentCamera local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() camera.CameraType = Enum.CameraType.Scriptable -- use enums camera.CFrame = campart.CFrame --//Fade fader.Visible = true for i = 1,0,.1 do fader.BackgroundTransparency = i wait() end fader:Destroy() wait(1) title.Visible = true wait(1) chapter.Visible = true wait(1) play.Visible = true play.MouseButton1Click:Connect(function() title.Visible = false chapter.Visible = false play.Visible = false camera.CameraType = Enum.CameraType.Custom workspace.Cameras.JoinedCam:Destroy() char.HumanoidRootPart.CFrame = CFrame.new(-553.1, -35.9, -24) --Spawnpoint end)
and HumanoidRootPart
isnt a object of the player object (game.Players.LocalPlayer) but the player's character.