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