New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 5 months ago
Edited 5 months ago

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)

0
put on the last line, "resetCameraSubject()" You never called your function xd greatneil80 1346 — 5mo
0
lol unsatisfie_d 1459 — 5mo
0
Great, he did. Nomededxz 0 — 5mo

2 answers

Log in to vote
1
Answered by 5 months ago
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!

0
Thanks HTHRWRU 6 — 5mo
0
your welcome! VVickedDev 39 — 5mo
Ad
Log in to vote
0
Answered by 5 months ago

strong text So yeah This worked Thank you!

Answer this question