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

Part1 is not a valid member of Workspace "Workspace"?

Asked by 3 years ago
Edited 3 years ago

Part1 is inside my Workspace, but I don't know why it can't find it or whatever.

Trying to make a 3d Shop.

Code:

local part = game.Workspace["Shop Pad"].OpenShop

part.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        local cam = workspace.CurrentCamera
        local  Part1 = game.Workspace.Part1
        local Stick = game.Workspace.Items.Stick

        cam.CameraType = "Scriptable"
        cam:Interpolate(Part1.CFrame, Stick.CFrame, 2)
    end
end)
0
Make sure that 'game.Workspace.Part1' is anchored. appxritixn 2235 — 3y

1 answer

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

Have you anchored it? Is the part's parent is a workspace? Try to use the following code instead:

local Part1 = workspace:FindFirstChild("Part1")

If it doesn't work please reply so I can think about how to fix it.

Ad

Answer this question