How to fix my custom menu camera being overriden?

I am attempting to make the players camera give a view of the whole map while they are in the menu screen that plays after the custom loading screen. I am setting the camera in the characteradded event to make sure the camera is loaded and then setting the cframe of the players camera. For some reason the camera is not being set and the player still has the default camera control. The players walk speed however is 0 so it is not an issue with character added being called. This is a local script inside replicated first as it is for my loading screen. I also get no errors.

Code:


script.Parent.Parent:RemoveDefaultLoadingScreen()

local RunService = game:GetService("RunService")

local LoadingScreen = script.Parent
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")

LoadingScreen.Parent = PlayerGui

local PlayConnection

local Time = tick()

local Spin = RunService.RenderStepped:Connect(function()
	LoadingScreen.Chicken.Rotation = math.sin(math.rad(tick() - Time) * 100) * 730
end)

if game:IsLoaded() == false then
	game.Loaded:Wait()
end

game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	workspace.CurrentCamera.CFrame = workspace.CameraPart.CFrame
	char:WaitForChild("Humanoid").WalkSpeed = 0
	char.Humanoid.JumpPower = 0
end)

local blur = Instance.new("BlurEffect")
blur.Parent = workspace.CurrentCamera

local PlayEvent = Instance.new("BindableEvent")
PlayEvent.Parent = game.ReplicatedStorage.Bindables
PlayEvent.Name = "PlayButton"

wait(6)

local fadeOut = coroutine.wrap(function()
	for i = 0, 1, .1 do
		RunService.RenderStepped:Wait()
		LoadingScreen.Background.BackgroundTransparency = i
	end 
end)
fadeOut()

LoadingScreen.Loading:TweenPosition(UDim2.new(1.5,0,.563,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, .5)
LoadingScreen.Chicken:TweenPosition(UDim2.new(1.5,0,.802,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, .5)
LoadingScreen.Play:TweenPosition(UDim2.new(.5,0,.654,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, .5)

wait(.5)

PlayConnection = LoadingScreen.Play.MouseButton1Click:Connect(function()
	Spin:Disconnect()
	PlayConnection:Disconnect()
	PlayEvent:Fire()
	repeat
		RunService.RenderStepped:Wait()
		blur.Size = blur.Size - .2
	until blur.Size == 0
	blur:Destroy()
end)

Change this to a repeat until the game is loaded. Does that fix anything? Are there any errors that have occurred?

Putting that in a repeat loop will do nothing.

that didnt fix it. It dont think thats the issue.

Do you have any errors? Did you try debugging to see where you are having ghe issue specifically?

please read the post as I state ther errors

Did you try debugging? Did you add print statements anywhere?

again, i stated in the post that the players character walkspeed is getting set to 0 so the error has to be in the character added event. Please read the post.

Add print statements in each line to see WHERE you’re having the issue. We can’t help you if we don’t know where exactly.

I literally said where, its in the character added event. that is where my camera code is and the humanoids walkspeed is getting set correctly so thats the issue.

Do the following:

game.Workspace.CurrentCamera.CFrame = CFrame.new(game.Workspace.(CameraName).CameraOrigin.Position,game.Workspace.(CameraName).CameraFace.Position)

my guy please stop asnwering your just making new ways to do the samething not solving my issue

You said you need help. Your camera script that is coded below is incorrect. I know this because I’ve used this script before.

I’m trying to help you but you are not being clear. You’re saying that the camera doesn’t work, I am showing you why.

This should be in a different local script in ReplicatedFirst. your code should be this:

local ReplicatedFirst = game:GetService("ReplicatedFirst")
ReplicatedFirst:RemoveDefaultLoadingScreen()

I’m doing the best I can to help you. What you’re doing isn’t very nice. I am offering my own time to help you yet I am receiving that message which is disheartening.

You said you have used this script before implying I copied this even though I made all of this and all of the suggestions are different ways to do the same thing such as making removedefaultloadingscreen but in a seperate script even though it does the same thing. I even tested it.

Your RemoveDefaultLoadingScreen() setup is wrong. Please read this: Customizing Loading Screens | Documentation - Roblox Creator Hub

As for your camera, is it a part? I don’t know. You don’t just copy and paste my code, you see if it fits with your game’s circumstances.

I didnt copy and paste this code. I made it for my game under my circumstances. I also looked at that article before and it doesnt say anything wrong with my code. The article merely says to call that removeDefautltloadingscreen it doesnt say if you have to use getservice or even the position of it in the code.

The article states where to put those 2 lines, you just need to read. I am no longer going to help you since you aren’t being helpful. I wish you the best of luck.

you dont need getservice and you are not getting what the article says so I cant really implement your methods

The following first sentences in the api class:

You always need to use the GetService with services.

Not in the case with replicated first as it is a part of the data model so I can simply access it like I would any other aspect of the game in the datamodel with game.Workspace". Even with all of that, it doesnt fix the issue with the camera even though i tried all of your methods.