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

Camera can be manipulated, but it will not change its CFrame in a coroutine (?)

Asked by 4 years ago

I have a camera that is being moved using TweenService while the player is on the join menu. I have changed the camera to Scriptable, but it will only get moved by the tween, not by setting the CFrame. This is bad because the players all spawn under the map and the camera not starting at the desired position is bad.

Snippet 1:

function CameraController()
    camera.CameraType = "Scriptable"

    while playerCam == false do
        camera.CFrame = defaultCamCFrame

        cameraOneManipulation:Play()
        wait(4.7)

        fade:Play()

        wait(0.45)

    end

    camera.CameraType = "Custom"

end

local CCC = coroutine.wrap(CameraController)

Snippet 2:

local playerCam = false

local camera = workspace.CurrentCamera

local defaultCamCFrame = CFrame.new(10, 10, 10)

I am new to camera manipulation and GUIs, so sorry if it is a stupid mistake.

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Snippet 1:

function CameraController()
    camera.CameraType = Enum.CameraType.Scriptable

    while playerCam == false do
        camera.CFrame = defaultCamCFrame

        cameraOneManipulation:Play()
        wait(4.7)

        fade:Play()

        wait(0.45)

    end

    camera.CameraType = "Custom"

end

local CCC = coroutine.wrap(CameraController)

Snippet 2:

local playerCam = false

local camera = workspace.CurrentCamera

local defaultCamCFrame = CFrame.new(10, 10, 10)
0
Thanks SuchASaltyLemon 35 — 3y
0
Np Harry_TheKing1 325 — 3y
Ad

Answer this question