I'm making a camera manipulation intro to my new game and I'm honestly puzzled on this. This is the current script I have:
local cam = workspace.CurrentCamera local camPart = workspace:WaitForChild("Cam")
cam.CameraType = Enum.CameraType.Scriptable cam.CFrame = camPart.CFrame + cam.CFrame.lookVector * 2 cam.CameraSubject = workspace:WaitForChild("Cam") camPart.Transparency = 1
(Cam is the part I'm using for my camera) how would I change it back to humanoid?
You can reset the camera back to the character by doing this:
if game.Players.LocalPlayer.Character then cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid end cam.CameraType = Enum.CameraType.Custom
It first checks if the character exists. Then, it sets the camera subject to the corresponding humanoid. Finally, it sets the camera type to custom (this allows the player to choose their own camera mode). You may change this if you had a setting for the CameraType
before.
the way you can do this is by first setting the camera subject and then the cameratype back to custom.
local cam = workspace.CurrentCamera local camPart = workspace:WaitForChild("Cam") cam.CameraType = Enum.CameraType.Scriptable cam.CFrame = camPart.CFrame + cam.CFrame.lookVector * 2 cam.CameraSubject = workspace:WaitForChild("Cam") camPart.Transparency = 1 delay(5,function() cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid cam.CameraType = Enum.CameraType.Custom end)
So this basically did everything you did in the script above (please use codeblocks) and makes a coroutine 5 seconds after the
cam.CameraType = Enum.CameraType.Scriptable cam.CFrame = camPart.CFrame + cam.CFrame.lookVector * 2 cam.CameraSubject = workspace:WaitForChild("Cam") camPart.Transparency = 1
runs. In the coroutine, it makes the player the camera subject and makes the camera type "custom"