how to make camera follow player after a delay

So, basically I want the camera to be steady. Then the player like “walks into the frame”, and then the camera should follow him from that point on. So, I want the camer ato follow the player after a dealy, or period of time.
I found this script in a different thread, but when I apply it to my camera and apply my “Player” to “player”, the camera just jumps to the player after 0.5 seconds, and that repeats itself over and over again. So I want the camera to jump to the player after like 2 seconds, and then follow him constantly.

This is the script from the other thread:

public class CameraController : MonoBehaviour 
{
     public GameObject player;
     private Vector3 offset;
     public float delay = 0.5f;
     private float followNow;
 
     void Start()
     {
         followNow = Time.time + delay;
         offset = transform.position;
     }
 
     void LateUpdate ()
     {
         if (Time.time > followNow) {
             if (player != null) {
                 transform.position = player.transform.position + offset;
             }
             followNow += delay;
         }
     }
 }

How can I achieve my goal?

using UnityEngine;
using System.Collections.Generic;

public class DelayedCameraFollower : MonoBehaviour 
{
	private struct PointInSpace
	{
		public Vector3 Position ;
		public float Time ;
	}
	
    [SerializeField]
	[Tooltip("The transform to follow")]
    private Transform target;
     
    [SerializeField]
	[Tooltip("The offset between the target and the camera")]
    private Vector3 offset;
	
	[Tooltip("The delay before the camera starts to follow the target")]
    [SerializeField]
    private float delay = 0.5f;
     
    [SerializeField]
	[Tooltip("The speed used in the lerp function when the camera follows the target")]
    private float speed = 5;
     
	///<summary>
	/// Contains the positions of the target for the last X seconds
	///</summary>
    private Queue<PointInSpace> pointsInSpace = new Queue<PointInSpace>();
 
    void LateUpdate ()
    {
		// Add the current target position to the list of positions
        pointsInSpace.Enqueue( new PointInSpace() { Position = target.position, Time = Time.time } ) ;
		
		// Move the camera to the position of the target X seconds ago 
		while( pointsInSpace.Count > 0 && pointsInSpace.Peek().Time <= Time.time - delay + Mathf.Epsilon )
		{
			transform.position = Vector3.Lerp( transform.position, pointsInSpace.Dequeue().Position + offset, Time.deltaTime * speed);
		}
    }
}

Hi, I wrote the same code and it works well but I’m doing it for a 2D game. Is there a way to lock the Z for the cam so it doesn’t overlap on the player?