I’m currently working on a third-person shooter and i want to place the camera above the player and looking slightly down so that the crosshair is over their head.
I’m trying to use the RunService and CurrentCamera to make this work, but I keep getting errors and i really have no idea how this works since there’s not many resources online for this topic.
heres a script that sets the position of the camera using CFrame.lookAt:
local player = game.Players.LocalPlayer
local DEPTH = 10
local HEIGHT = 3
local function updateCamera()
local character = player.Character
if character then
local hrpPosition = character:WaitForChild("Head").Position
local cameraPosition = Vector3.new(hrpPosition.X, hrpPosition.Y + HEIGHT,hrpPosition.Z + DEPTH)
workspace.CurrentCamera.CFrame = CFrame.lookAt(cameraPosition, hrpPosition)
end
end
game:GetService("RunService"):BindToRenderStep("function",201,updateCamera)
you’re probably gonna need to change DEPTH and HEIGHT to get what you want