How can I make it so that the camera does not pass through the car but passes by it?
Here is the script for the tween
Imgur: The magic of the Internet
if input.KeyCode == Enum.KeyCode.C then
if script.Parent.Visible == false and carWatch == false and carModel2 or carModelFirstEntry2 then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
--workspace.CurrentCamera.CFrame = CFrame.new(workspace.DealerShip.CamPosition.Position,Vector3.new(-1237.333, -143.469, 390.062))
script.Parent.CarPreviewFrame.Visible = true
script.Parent.CarsScrollingFrame.Visible = true
script.Parent.Comanda.Text = "TO VIEW THE CAR"
script.Parent.Comanda.ImageLabel.Image = "rbxassetid://10376411707"
carWatch = true
print(carWatch)
TweenS:Create(
cam,
TweenInfo.new(
2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0,
false,
0
),
{CFrame =CFrame.new(workspace.DealerShip.CamPosition.Position,Vector3.new(-1237.333, -143.469, 390.062))}
):Play()
player.CameraMaxZoomDistance = 30
player.CameraMinZoomDistance = 30
end
end