I’m trying to access the players primaryPart position but it keeps coming back with an error “Cframe is not a valid member of humanoidRootPart”, my end goal is to make the players camera slightly look down to give a “2Dish” feel and always follow the player (picture), I’ve already tried going on youtube and forums but I still can’t figure out why it won’t work (it’s also in starter characterScript), any help would be appreciated
local RunService = game:GetService("RunService")
local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")
local char = playerModel:WaitForChild("HumanoidRootPart")
local cam = workspace.CurrentCamera
local function basicCamera()
cam.CameraType = Enum.CameraType.Scriptable
local playerX = math.rad(char.Cframe.Position.X - 10)
local playerY = math.rad(char.Cframe.Position.Y + 20)
local pos = Vector3.new(playerX, playerY, char.Cframe.Position.Z)
local lookAt = char
if humanoid.MoveDirection.Magnitude > 0 then -- Is the character walking?
cam.CFrame = CFrame.lookAt(pos,lookAt)
else
cam.CFrame = CFrame.lookAt(pos, lookAt)
end
end
RunService.RenderStepped:Connect(basicCamera)