"attempt to call a CFrame value"

UserSettings().GameSettings.RotationType = Enum.RotationType.MovementRelative

local currentTarget = workspace.AkkozaTEST–nil

game:GetService(“RunService”).Heartbeat:Connect(function()
local character = game.Players.LocalPlayer.Character

if character then
if currentTarget and currentTarget.PrimaryPart then
game.Workspace.CurrentCamera.Focus(currentTarget.PrimaryPart.CFrame)
end
end
end)

I’m trying to make a script that locks onto the “currentTarget” value, and I have a testing model in workspace [which is just my character] and keep getting this error

image

Focus is a CFrame value. You’re trying to call it. The call syntax is (). Technically to make function calls you do not need () to wrap the parameters in, but this only works on tables and strings; func""; func{}

Try this:

game.Workspace.CurrentCamera.Focus = currentTarget.PrimaryPart.CFrame

1 Like

I have replaced the line with what you sent, and it’s active like the normal camera still, with no errors [tried changing Camera type to Scriptable too]

What do you mean by this. So the camera looks at a specific direction? Or so that the camera’s origin is of this specific position.

what i’m trying to do is make the camera focus on the primary part, and when the player moves, it stays locked onto it, but still allow you to zoom out