How to prevent camera warping after object is past camera origin?

Essentially, I want to have it so that my camera can point at an object from any position and any angle while the object changes position. For example, in airplane games, players might do barrel rolls and the camera will adjust accordingly such that the camera no matter what orientation has a relative top-down view on the plane.

Right now, I’m using the following to get my camera to point at a moving object:

camera.CFrame = CFrame.new(origin, part.Position)

The problem with this is that if the part moves past the camera, the camera will warp.
What’s a different way to approach this?
Thanks in advanced.

Example:

Reproduceable Code:

    local camera = workspace.CurrentCamera;
    camera.CameraType = Enum.CameraType.Scriptable;
    local part = workspace.Part;
    camera.CFrame = part.CFrame * CFrame.new(5,8,0);
    local origin = camera.CFrame;
    local partOrigin = part.CFrame;
    local s = tick();

    while true do
    if ( tick() - s > 8 ) then
    break;
    end
    wait()
    part.CFrame = partOrigin * CFrame.new( -8 * math.sin(tick()), 0, 0 );
    camera.CFrame = CFrame.new( origin.p, part.CFrame.p );
    end