How can I change the camera script that follows it on the y axis?

Hey guys.

I need a little help. I have a camera script that works perfectly only one thing. When I teleport the player down to another place in the same scene, I want that the camera works excatly same as above. How can I do this?

Here is a video what I mean:
https://www.youtube.com/watch?v=FnO441nnZXo

Camera script:

    using UnityEngine;
    using System.Collections;
    
    public class MainCamera : MonoBehaviour {
    
    	public Transform target;
    	public int zOffset;
    	public int minimumHeight = 0;
    
    	float orthoSize;
    	float currentY;
    	Vector3 position;
    
    	// Use this for initialization
    	void Start () {
    		orthoSize = camera.orthographicSize;
    	}
    	
    	// Update is called once per frame
    	void LateUpdate () {
    		position = target.position;
    		position.z -= zOffset;
    
    		currentY = target.position.y;
    
    		if (currentY > minimumHeight + orthoSize - 1) 
    		{
    			position.y = currentY - orthoSize + 1;	
    		}
    		else
    		{
    			position.y = minimumHeight;
    		}
    
    		transform.position = position;
    	}
    }

It looks like you might need to change the minimum height variable when the character is teleported below the world. Alternatively, you could move you teleport location to the left or right of your main level geometry (instead of underneath it) to preserve the minimum height for the camera.