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

Local Script won't read the workspace?

Asked by 3 years ago

This question has been solved by the original poster.

So basically I made a cutscene script that is supposed to work. I always get this error: "PartA is not valid member of Model". PartA is member of that model but still, it doesn't work. Anyone know why?

wait(1)
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.CutScene.PartA, game.Workspace.CutScene.PartB, 1.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)

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

Cutscene()

0
Make sure that you name the Part right. Block_manvn 395 — 3y
0
Oh right I forgot, you should use WaitForChild() . Because maybe the PartA isn't replicate to the client yet. https://developer.roblox.com/en-us/api-reference/function/Instance/WaitForChild Block_manvn 395 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

It seems like a temporary problem, I ran it again and it worked.

Ad

Answer this question