Problem using DontDestroyOnLoad carrying over a player, but not a camera

So, I am trying to make an overhead 2D RPG.
The tutorial series I am watching carried over both the Camera and the Player, but I want the camera background to have a different color in this different scene.
Now here’s my question, is there a way to have the camera follow something that is in the DontDestroyOnLoad category? Or is there some way to have this Camera change background color when it switches to a new scene?

DontDestroyOnLoad(transform.gameObject);
        if (GameObject.Find(gameObject.name)
                 && GameObject.Find(gameObject.name) != this.gameObject)
        {
            Destroy(GameObject.Find(gameObject.name));
        }

(This is the code I use for the Player)

{
    public GameObject followTarget;
    private Vector3 targetPos;
    public float moveSpeed;
    
        // Use this for initialization
        void Start () {
    
        }
    	
    	// Update is called once per frame
    	void Update () {
            targetPos = new Vector3(followTarget.transform.position.x, followTarget.transform.position.y, transform.position.z);
            transform.position = Vector3.Lerp(transform.position, targetPos, moveSpeed * Time.deltaTime);
    	}
}

(And this is the camera script)

I’m not totally sure that this is what you mean, but a great way to always be able to get a component, as long as it is alive, no matter if it was instantiated in the same scene or not, is to add a script on it that has a static reference that you can call from anywhere.

Lets say you want to get the position of an object that was instantiated in another scene with DontDestroyOnLoad. If you put a script on that object that looks like this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ObjectThatIsAlive : MonoBehaviour {

	public static ObjectThatIsAlive Instance { get; private set; }

	private void Awake()
	{
        DontDestroyOnLoad(gameObject);
		Instance = this;
	}
	public Vector3 GetCurrentPosition(){
		return transform.position;
	}
}

You can then access this from any other script at any time by calling

	Vector3 position = ObjectThatIsAlive.Instance.GetCurrentPosition();

Note that if you wanna do this the right way, you should look at how a singleton is implemented. The problem here is that if you do this, you can’t use this script on any other gameobject, since there can never be more than one static reference. If you add this script to another component, the latest invoked one will be the one with the static reference. If you want to destroy this object at any time, you’ll have to set the static reference to null and then have a check for that when ever you want to use it.

You can do any of the two things.

If you want to carry over both your player and camera, you can change your camera settings (like your background) right after your new scene load call, as the script from where you’re loading the new scene will still run to completion. It won’t return immediately after you load the new scene. Or another way is by having an object (for example an empty) in your new scene, find your camera in its Awake() and change its settings there.

If you want to carry your player only with DontDestroyOnLoad, you can find your player from your new camera Awake() in your new scene and set it as the target.