How to use camera manipulation?

I’m creating this exploration game and I need to make the camera return to the player when he/she presses a gui button. I would require assistance now plz.

P.S I know how to make it spin! :smiley:

1 Like

If you’re wanting to use a tween to return to the player, I can’t help you on that really.

But to return to the player, like teleport the camera to the player, here’s what I do:

local camera = game.Workspace.CurrentCamera --This gets the camera
local plr = game:GetService("Players").LocalPlayer --This retrieves the local player
local char =  plr.Character --This gets the character from the player
camera.CameraType = Enum.CameraType.Custom --This makes the camera's type custom, or the default camera.
camera.CameraSubject = char.Humanoid --This puts the camera's subject on the Humanoid of the player's character

This will then return the player’s camera to the player itself.

where do you put this script in?

Try to figure it out, however I will tell you put this in startercharacterscripts, since once the character dies there humanoid will be reset so you would need to update it everytime the player dies, but when you put a script in startercharacterscripts, it gets copied into the character everytime the player respawns.

1 Like

ok thank you for the tip! :smiley: