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

Cutscene script half works but half doesn't. Could you help?

Asked by 3 years ago

So, I was making a cutscene function for my game. It zooms in on 1 person and then the next, but after it zooms in on the first person, the camera seems to not move to the second and no errors show up in the output. Here's the script:

local remoteEvent = game.ReplicatedStorage.map1.Start

local TweenService = game:GetService("TweenService")
local Camera = game.Workspace.CurrentCamera

local function MoveCamera(StartPart, EndPart, Duration, EasingStyle, EasingDirection)
    Camera.CameraType = Enum.CameraType.Scriptable
    Camera.CFrame = StartPart.CFrame
    local Cutscene = TweenService:Create(Camera, TweenInfo.new(Duration, EasingStyle, EasingDirection), {CFrame = EndPart.CFrame})
    Cutscene:Play()
    wait(Duration)
end

local function Cutscene()
    MoveCamera(game.Workspace.map1.CutsceneParts.PartA, game.Workspace.map1.CutsceneParts.PartB, 1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
    MoveCamera(game.Workspace.map1.CutsceneParts.PartC, game.Workspace.map1.CutsceneParts.PartD, 1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)

    wait(.5)
    Camera.CameraType = Enum.CameraType.Custom
    Camera.CameraSubject = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
end


remoteEvent.OnClientEvent:Connect(Cutscene)

If you could answer, it would be really helpful. Thanks!

0
maybe do camersubject before the cameratype MarkedTomato 810 — 3y

Answer this question