Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

1 comment

0

Are you using a Script or LocalScript? Also, did any errors pop up when you were trying to use the script?

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.