Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera.CFrame won't loop through multiple cameras for my menu GUI?

Asked by 1 year ago
Edited 1 year ago

I'm trying to loop cameras for my menu GUI with multiple camera parts, but it won't work, any help please?

local camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local menu = game.Workspace.MenuCamera

local Char = Player.Character or Player.CharacterAdded:Wait()
Char:WaitForChild("HumanoidRootPart").Anchored = true

local function camerastuff()
    camera.CameraType = Enum.CameraType.Scriptable
    camera.CFrame = menu.Cam1.CFrame
    wait(2)
    camera.CFrame = menu.Cam1.CFrame
    wait(2)
end

game:GetService("RunService").RenderStepped:Connect(camerastuff)

script.Parent.TextButton.MouseButton1Click:Connect(function()
    camera.CameraType = Enum.CameraType.Custom
    Char:WaitForChild("HumanoidRootPart").Anchored = false
    script.Parent.TextButton:Destroy()
    script:Destroy()
end)
0
ur code doesn't run after line 23 lol, its stuck ina while loop. maybe add a break or some condition ZeroToH3ro 82 — 1y
0
Ok now I changed it but otherwise it wont let me use more than 1 camera part for my menu Meru_Noxeru 9 — 1y
0
no no, u could've kept ur original code, u just needed to add a debounce ZeroToH3ro 82 — 1y
0
it looked like u had some sort of debounce system going, u were just using it wrong ZeroToH3ro 82 — 1y
View all comments (4 more)
0
it wasn't working even when i tried different methods Meru_Noxeru 9 — 1y
0
can u edit ur post & add ur original code again, ill help u with the debounce ZeroToH3ro 82 — 1y
0
I just worked around it by putting the camera to one cframe and changing the parts cframe around the map Meru_Noxeru 9 — 1y
0
alr good job ZeroToH3ro 82 — 1y

Answer this question