Attempt to call a boolean value problem how do I fix it?
I'm trying to make the camera follow a part around but I have a problem, when I type in
It says
Players.longjohnnn.PlayerGui.ScreenGui.Start Frame.Play.Starter Script:19: bad argument #3 (CFrame expected, got Object)
But when I type in
1 | cam.Focus = CameraPart.CFrame |
It says
attempt to call a boolean value.
Here is the whole script
01 | local Play = script.Parent |
02 | Play.MouseButton 1 Up:Connect( function () |
03 | local StartFrame = script.Parent.Parent |
04 | local Settings = script.Parent:FindFirstAncestor( "Settings" ) |
05 | spawn(StartFrame:TweenPosition( |
06 | UDim 2. new ( 0.999 , 0 , - 0.125 , 0 ), |
12 | local TempCar = game.Workspace:WaitForChild( "TempCar" ) |
13 | local CameraPart 2 = TempCar.CameraPart 2 |
14 | local cam = game.Workspace.CurrentCamera |
15 | local CameraPart = TempCar.CameraPart |
16 | cam.CameraType = "Scriptable" |
17 | local Runservice = game:GetService( "RunService" ) |
18 | Runservice.Heartbeat:Connect( function (step) |
19 | cam.Focus = CameraPart.CFrame |