I'm trying to figure out a way to set the players' camera's CFrame position that stays in the same place and doesn't move.
Could anyone help me out
I'm trying to figure out a way to set the players' camera's CFrame position that stays in the same place and doesn't move.
Could anyone help me out
To accomplish this task, you should follow these steps:
1.) Add a remote event named ChangeCamera to ReplicatedStorage 2.) Add a local script into the starter scripts folder 3.) Add a server script into ServerScriptService
The local script will look like this:
game.ReplicatedStorage.ChangeCamera.OnClientEvent:Connect(function()
wait()
repeat workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable until workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = CFrame.new(workspace.Reference.Position)
end)
The server script will look like this:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
game.ReplicatedStorage.ChangeCamera:FireClient(plr)
end)
end)
Sorry that the first answer didn't work, I forgot to change the CameraType
-Cmgtotalyawesome
EDIT: This will 100% work this time, I tested it out in my studio. The problem was not adding a wait to the script.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
I'm 100% sure I fixed it this time, I just ran it in my own game