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

How to make when you press a button the camera returns to LocalPlayer?

script.Parent.MouseButton1Click:Connect(function() local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer local function resetCameraSubject() if workspace.CurrentCamera and localPlayer.Character then local humanoid = localPlayer.Character:FindFirstChildOfClass("Humanoid") if humanoid then workspace.CurrentCamera.CameraSubject = humanoid end end end end)

3 comments

0

put on the last line, "resetCameraSubject()" You never called your function xd

0

lol

0

Great, he did.

2 answers

✓ Accepted answer
game.Workspace.CurrentCamera.CameraType = "Custom"--Enables the ability to change the camera

game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

Lol just plugged it in. use this code. Make the camera Custom so you could change it. Hope this helps! Upvote to support me and if it helps, Mark question as answered for my answer please!

2 comments

0

Thanks

0

your welcome!

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