How can I make it so the camera follows the head instead of the humanoid?

.CameraSubject doesn’t work since it only tracks the position and not the rotation.

a̶l̶s̶o̶ ̶i̶s̶t̶g̶ ̶i̶f̶ ̶s̶o̶m̶e̶o̶n̶e̶ ̶l̶i̶n̶k̶s̶ ̶m̶e̶ ̶t̶h̶e̶ ̶"̶c̶a̶m̶e̶r̶a̶ ̶m̶a̶n̶i̶p̶u̶l̶a̶t̶i̶o̶n̶"̶ ̶a̶r̶t̶i̶c̶l̶e̶ ̶f̶r̶o̶m̶ ̶t̶h̶e̶ ̶d̶o̶c̶u̶m̶e̶n̶t̶a̶t̶i̶o̶n̶ ̶s̶a̶y̶i̶n̶g̶ ̶"̶t̶h̶e̶r̶e̶ ̶m̶i̶g̶h̶t̶ ̶b̶e̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶ ̶u̶s̶e̶f̶u̶l̶ ̶i̶n̶ ̶t̶h̶e̶r̶e̶"̶ ̶i̶m̶ ̶g̶o̶n̶n̶a̶ ̶p̶u̶n̶c̶h̶ ̶a̶ ̶h̶o̶l̶e̶ ̶i̶n̶ ̶m̶y̶ ̶w̶a̶l̶l

might be something useful in there

2 Likes

hello can you send me a script you have problem with

maybe do something like

RunService.RenderStepped:Connect(function()
	Camera.CFrame = Head.CFrame
end)

LocalScripts will not run in ServerScriptService. They only run in:

The player’s Backpack
The player’s PlayerGui
The player’s character
The player

punch

(jk its from google pics)

that does not work + it breaks the camera

local Camera = game.Workspace.CurrentCamera
local RunService = game:GetService("RunService")
local Head = game.Players.LocalPlayer.Character:WaitForChild("Head")

Camera.CameraSubject = Head

RunService.RenderStepped:Connect(function()
	Camera.CFrame = Head.CFrame
end)

it works but i cant move my camera and also my character is visible.
i know how to make my character invisible but idk what to do to make the camera move

Nevermind! After a bit of brainstorming I came up with this :

local Camera = game.Workspace.CurrentCamera
local RunService = game:GetService("RunService")
local Head = game.Players.LocalPlayer.Character:WaitForChild("Head")
local Humanoid = Head.Parent:WaitForChild("Humanoid")

Camera.CameraSubject = Head

local Mouse = game.Players.LocalPlayer:GetMouse()

local whitelist = {
	"UnionOperation",
	"Part",
	"BasePart",
	"MeshPart"
}

local UserInputService = game:GetService("UserInputService")

local root = game.Players.LocalPlayer.Character.HumanoidRootPart

RunService.RenderStepped:Connect(function()
	Camera.CFrame = Head.CFrame
	if Mouse.hit ~= nil then
		Camera.CFrame = CFrame.new(Camera.CFrame.Position, Mouse.Hit.Position)
	end
	for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
		if v.Name ~= "HumanoidRootPart" and table.find(whitelist, v.ClassName) and not v:FindFirstAncestorOfClass("Tool") then
			v.Transparency = 1
		end	
	end
	UserInputService.MouseBehavior = Enum.MouseBehavior.Default
        Humanoid.AutoRotate = false
end)

Works like a charm!

It’s missing some stuff but it’s intended for a single-player fps so it really doesn’t matter.

2 Likes

You don’t have to set the CFrame. All you have to do is set the CameraSubject.

.CameraSubject doesn’t work since it only tracks the position and not the rotation.

update : this doesn’t work that well and causes MANY MANY MANY MANY MANY MANY MANY bugs.