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

Why dosen't my script change the camera back to the player camera?

Asked by 5 years ago

I made a code that changes the camera subject, but now i'm trying to make a button that switches it back to the player camera i tried for a while now but it dosen't work.

code:

local Camera = workspace.CurrentCamera

local player = game.Players.LocalPlayer

script.Parent.TextButton.Activated:Connect(function()

Camera.CameraSubject = player.Character.Humanoid

end)

0
Are you using a Script or LocalScript? Also, did any errors pop up when you were trying to use the script? TheeDeathCaster 2368 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Place this as a LocalScript in StarterGui:

local Camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
script.Parent.TextButton.Activated:Connect(function()
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = Enum.CameraType.Custom
end)

It may work.

Ad

Answer this question