Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attempt to call a boolean value problem how do I fix it?

Asked by 4 years ago

I'm trying to make the camera follow a part around but I have a problem, when I type in

cam.Focus = CameraPart

It says

Players.longjohnnn.PlayerGui.ScreenGui.Start Frame.Play.Starter Script:19: bad argument #3 (CFrame expected, got Object)

But when I type in

cam.Focus = CameraPart.CFrame

It says

attempt to call a boolean value.

Here is the whole script

local Play = script.Parent
Play.MouseButton1Up:Connect(function()
    local StartFrame = script.Parent.Parent
    local Settings = script.Parent:FindFirstAncestor("Settings")
    spawn(StartFrame:TweenPosition(
        UDim2.new (0.999, 0, -0.125, 0),
        "Out",
        "Back",
        1,
        false
        ))
local TempCar = game.Workspace:WaitForChild("TempCar")
local CameraPart2 = TempCar.CameraPart2
local cam = game.Workspace.CurrentCamera
local CameraPart = TempCar.CameraPart
cam.CameraType = "Scriptable"
local Runservice = game:GetService("RunService")
    Runservice.Heartbeat:Connect(function(step)
        cam.Focus = CameraPart.CFrame
    end)
end)
0
when it says attempt to call a Boolean value, is that error also on line 19? Diamond52002 29 — 4y
0
Why not cam.CFrame = CameraPart.CFrame SethHeinzman 284 — 4y
0
It doesn't show where it is Longjohnnn 28 — 4y
0
Okay I did cam.CFrame and now it's working! thank you Longjohnnn 28 — 4y

Answer this question