when the editor opens, i have it so the camera gets set as an overhead camera, this is for build mode in my game, and then the character just indefinitely, ever few seconds respawns and the game reloads. thank so much for any help the only thing i can think of is that i have a custom StarterCharacter for the game but i don’t know why that would break this camera script
local gui = script.Parent
local player = game.Players.LocalPlayer
local lot = game.Workspace:WaitForChild("Lots"):WaitForChild(player.Name) -- this just gets the player's lot, so the camera can view the correct area
gui:GetPropertyChangedSignal("Visible"):Connect(function()
if gui.Visible == true then -- edit
local FOV = 60
local camera = game.Workspace.CurrentCamera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Scriptable
local pos = lot.OverheadCam.Position -- part about 10 studs above floor, these parts are both anchored so that can't be the problem
local pos2 = lot.LookAtPoint.Position -- part on floor for camera to be facing
camera.CoordinateFrame = CFrame.new(pos, pos2) -- set cam
else -- done, sets camera back to default when build gui is closed
local FOV = 70
local camera = game.Workspace.CurrentCamera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Follow
end
end)
local gui = script.Parent
local player = game.Players.LocalPlayer
local lot = workspace:WaitForChild("Lots"):WaitForChild(player.Name) -- this just gets the player's lot, so the camera can view the correct area
local defaultCamera = workspace.CurrentCamera
gui:GetPropertyChangedSignal("Visible"):Connect(function()
if gui.Visible then -- edit
local FOV = 60
local camera = Instance.new("Camera")
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Scriptable
local pos = lot.OverheadCam.Position -- part about 10 studs above floor, these parts are both anchored so that can't be the problem
local pos2 = lot.LookAtPoint.Position -- part on floor for camera to be facing
camera.CFrame = CFrame.new(pos, pos2) -- set cam
workspace.CurrentCamera = camera
else -- done, sets camera back to default when build gui is closed
workspace.CurrentCamera = defaultCamera
end
end)
local gui = script.Parent
local player = game.Players.LocalPlayer
local lot = game.Workspace:WaitForChild("Lots"):WaitForChild(player.Name) -- this just gets the player's lot, so the camera can view the correct area
gui:GetPropertyChangedSignal("Visible"):Connect(function()
if gui.Visible then -- edit
local FOV = 60
local camera = workspace.CurrentCamera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Scriptable
local pos = lot.OverheadCam.Position -- part about 10 studs above floor, these parts are both anchored so that can't be the problem
local pos2 = lot.LookAtPoint.Position -- part on floor for camera to be facing
camera.CFrame = CFrame.lookAt(pos, pos2) -- set cam
else -- done, sets camera back to default when build gui is closed
local FOV = 70
local camera = workspace.CurrentCamera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = player.Character.Head
end
end)
sadly nope, still crashes. i honestly think this could be some kind of internal bug with roblox’s camera system or something. im gonna send a bug report
local gui = script.Parent
local player = game.Players.LocalPlayer
local lot = game.Workspace:WaitForChild("Lots"):WaitForChild(player.Name) -- this just gets the player's lot, so the camera can view the correct area
gui:GetPropertyChangedSignal("Visible"):Connect(function()
if gui.Visible == true then -- edit
local FOV = 60
local camera = game.Workspace.Camera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Scriptable
local pos = lot.OverheadCam.Position -- part about 10 studs above floor, these parts are both anchored so that can't be the problem
local pos2 = lot.LookAtPoint.Position -- part on floor for camera to be facing
camera.CFrame = CFrame.new(pos, pos2) -- set cam
else -- done, sets camera back to default when build gui is closed
local FOV = 70
local camera = game.Workspace.Camera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Follow
end
end)
local gui = script.Parent
local player = game.Players.LocalPlayer
local lot = game.Workspace:WaitForChild("Lots"):WaitForChild(player.Name) -- this just gets the player's lot, so the camera can view the correct area
gui:GetPropertyChangedSignal("Visible"):Connect(function()
if gui.Visible == true then -- edit
local FOV = 60
local camera = game.Workspace.CurrentCamera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Scriptable
local pos = lot.OverheadCam.Position -- part about 10 studs above floor, these parts are both anchored so that can't be the problem
local pos2 = lot.LookAtPoint.Position -- part on floor for camera to be facing
camera.CoordinateFrame = CFrame.new(pos, pos2) -- set cam
else -- done, sets camera back to default when build gui is closed
local FOV = 70
local camera = game.Workspace.CurrentCamera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Follow
end
end)
your script:
local gui = script.Parent
local player = game.Players.LocalPlayer
local lot = game.Workspace:WaitForChild("Lots"):WaitForChild(player.Name) -- this just gets the player's lot, so the camera can view the correct area
gui:GetPropertyChangedSignal("Visible"):Connect(function()
if gui.Visible == true then -- edit
local FOV = 60
local camera = game.Workspace.Camera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Scriptable
local pos = lot.OverheadCam.Position -- part about 10 studs above floor, these parts are both anchored so that can't be the problem
local pos2 = lot.LookAtPoint.Position -- part on floor for camera to be facing
camera.CFrame = CFrame.new(pos, pos2) -- set cam
else -- done, sets camera back to default when build gui is closed
local FOV = 70
local camera = game.Workspace.Camera
camera.FieldOfView = FOV
camera.CameraType = Enum.CameraType.Follow
end
end)
the only difference is Camera and CurrentCamera
and CurrentCamera is better