Hello! So I made this Loading Screen, which gets the players camera, and parent’s it to this part in the Workspace. When the player clicks a button, it will change their camera back to their Humanoid, and delete the play button, and blur. However, there are no errors, the camera doesn’t get parented to the brick, and when you click the button, it doesn’t delete anything. Please help!
Script:
local MenuCamera = game.Workspace:WaitForChild("MenuCamera")
local PlayButton = script.Parent:WaitForChild("PlayButton")
-------------------------------------------
local LoadBlur = Instance.new("BlurEffect")
LoadBlur.Parent = game.Lighting
LoadBlur.Name = "LoadBlur"
LoadBlur.Enabled = true
LoadBlur.Size = 24
-------------------------------------------------
game.Players.PlayerAdded:Connect(function(Player)
local Camera = Player.Character:WaitForChild("Camera")
Camera.CameraType = Enum.CameraType.Scriptable
Camera.Parent = MenuCamera
---------------------------------------------------
PlayButton.MouseButton1Click:Connect(function()
LoadBlur:Destroy()
PlayButton:Destroy()
Camera.CameraType = Enum.CameraType.Custom
end)
end)
Player Cameras cannot be accessed by the server. You’ll have to change the camera on the client. Try sending a RemoteEvent to the client, with the desired CFrame. For example:
Server:
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("<REMOTENAME>")
local CamCF = DesiredCF -- Replace with CFrame you want to use
game:GetService("Players").PlayerAdded:Connect(function(plr)
Remote:FireClient(plr,CamCF)
end)
Client:
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("<REMOTENAME>")
Remote.OnClientEvent:Connect(function(CF)
local Cam = workspace.CurrentCamera -- CurrentCamera is a property of workspace
Cam.CameraType = Enum.CameraType.Scriptable
Cam.CFrame = CF
end)
This doesn’t encompass undoing the action, but if you need help with that, just reply.
What would I change the CamCF? Just the CFrame (CFrame.new()) or the actual players camera change CFrame? (Player.Camera = CFrame.new(workspace.MenuBrick)