How to fix my custom menu camera being overriden?

Hello! can you add a wait() before setting the camera?

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)

char:WaitForChild("Humanoid").WalkSpeed = 0

char.Humanoid.JumpPower = 0

wait(1)

workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable

workspace.CurrentCamera.CFrame = workspace.CameraPart.CFrame

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)```

@WooleyWool @Skippy_Development May you guys stop? You are prioritizing this argument instead of helping the OP. I appreciate your help, but an argument won’t even solve this problem.

@OP, anyways, have you printed the property of CurrentCamera? This might give us a clue to whether it was set or not.

If not, you could go to #platform-feedback:engine-bugs and see if there is a topic related to the camera.

Here are the latest posts about camera in #platform-feedback:engine-bugs:

  1. Release 447 broke camera controls - #51 by RiloTheFox
  2. Pressing Ctrl while zooming forces you to hold Ctrl to zoom manually, otherwise tilts camera
  3. Horizontal scroll w/ mouse wheel breaks camera zoom and instead tilts camera - #25 by koob85
  4. Attach camera controls broken

If you look at my previous reply, i’ve tried to provide feedback on how the code can be fixed due to how the cframe is set up. The thing is, we don’t know how the camera is set up. We don’t know if it’s a part or model. Here is the earlier code i’ve provided:

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

I did your CharacterAdded event and it also didn’t set for me, maybe try removing it? Also, why not put it somewhere that is not ReplicatedFirst? Instances won’t be loaded when a LocalScript is ran in ReplicatedFirst.

Hello everyone, I found out the issue and I guess the camera script has to be initially set in startercharacterscripts for it then to be manipulating. Thanks for taking time out to help me though. :grin:

2 Likes

What about PlayerAdded? Doesn’t that change anything?

So there wasn’t anything with the script? That’s great to hear >:)

Nope, there wasnt , the changes you suggested didnt really do much

Well, at least it works!I do suggest using the GetService in the future :stuck_out_tongue:

thanks for the advice, I already do use getservice on all of my scripts but this was a exception
since I am only using replicated storage once and this script is deleted once it finishes.

1 Like