I've already tried a load of methods including wrap in order to try and have this function run multiple times so long as the Value is true. It only runs once however and every time I use 'coroutine.wrap', it outputs something about thread values. I just want the camera to rotate as shown below while the value is true.
-- CODE BELOW --
local SelectedVehicle = workspace:WaitForChild('Cessna')
Config.MenuActive.Changed:Connect(function(Value)
print(Value)
if Value == true then
DealershipCam = coroutine.create(function()
Camera.CameraSubject = SelectedVehicle
while wait() do
local SideVector = (Camera.CoordinateFrame - Camera.CoordinateFrame.p) * Vector3.new(1,0,0)
Camera.CoordinateFrame = CFrame.new(Camera.CoordinateFrame.p + (SideVector * .05))
Camera.Focus = SelectedVehicle.PrimaryPart.CFrame
if Config.MenuActive.Value == false then
coroutine.yield(DealershipCam)
break
end
end
end)
coroutine.resume(DealershipCam)
end
end)

3 comments
Everything works without the if statements and changed functions basically.
The camera does change subject and it constantly focuses on the object as it forces me to view it when I move the camera. However, it just doesn't move around with the change function and if statement
Is MenuActive a BoolValue Object?