Ad
Log in to vote
0

How do I set the local players camera to the front surface of a block?

Asked by 1 month ago

i wanna make the character look at a item, and a blocks front surface is the view point, but when i step on the block, it says: Attempt to index nil with "Camera" on line 10?

--Variables--
local Brick = script.Parent
--End--

--Code--
local function PlayerTouched(Part)
    local Parent = Part.Parent
    if game.Players:GetPlayerFromCharacter(Parent) then
        script.Parent.Sound:Play()
        game.Players.LocalPlayer.Camera = workspace.Cameras.YourHand.FrontSurface
    end
end
Brick.Touched:connect(PlayerTouched)
0
Is this a local script? johnoscarbhv1 122 — 1mo
0
yes Jakob_Cashy 67 — 1mo
0
Local script doesnt work in workspace johnoscarbhv1 122 — 1mo
0
Local script doesnt work in workspace johnoscarbhv1 122 — 1mo

Answer this question