Why is Instantiate() not working?

So, I decided to try 2D for the first time. I am making a game where you control two brothers. If the two brothers stand on two switches simultaneously, a button should appear which when pressed by one of the brothers, will take me to the next level.

But when the necessary conditions are provided, the button is not spawning. Here’s a picture of the editor.
alt text
Here’s the code I’m using.

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

public class GameManager : MonoBehaviour
{
    PlayerController playerControllerOne;
    PlayerController playerControllerTwo;
    [SerializeField] GameObject button;
    bool buttonSpawned;
    GameObject buttonCopy;
    [SerializeField] float buttonDestroyDelay;
    int currentLevel;

    void Start() {
        DontDestroyOnLoad(gameObject);
        buttonSpawned = false;

        if (!PlayerPrefs.HasKey("level")) { PlayerPrefs.SetInt("level", 1); }
    }

    void Update() {
        //Getting the two PlayerController Scripts
        if (currentLevel > 0 && playerControllerOne == null) { playerControllerOne = GameObject.Find("Brother - 1").GetComponent<PlayerController>(); }
        if (currentLevel > 0 && playerControllerTwo == null) { playerControllerTwo = GameObject.Find("Brother - 2").GetComponent<PlayerController>(); }

        if (playerControllerOne != null || playerControllerTwo != null)
        {
            //Checking if the two switches are pressed and if the button is already spawned or not.
            if (playerControllerOne.switchPressed && playerControllerTwo.switchPressed && !buttonSpawned)
            {
                buttonCopy = Instantiate(button); //Spawning the copy of the button
                buttonSpawned = true;//Telling the code it has been spawned
            }
            //Checking if one of the switches or both of them have been released and if the button has already been spawned
            else if (!playerControllerOne.switchPressed || !playerControllerTwo.switchPressed && buttonSpawned)
            {
                Destroy(buttonCopy, buttonDestroyDelay);//Destroying the button after the delay
                buttonSpawned = false;//Telling the code it has been destroyed
            }

            //Leveling up
            if (playerControllerOne.buttonPressed || playerControllerTwo.buttonPressed)
            {
                currentLevel++;
                ChangeScene(currentLevel);
            }
        }
    }

    void ChangeScene(int level)
    {
        PlayerPrefs.SetInt("level", level);
        SceneManager.LoadScene(PlayerPrefs.GetInt("level"));
        currentLevel = level;
        playerControllerOne = null;
        playerControllerTwo = null;
    }

    public void ResumeGame()
    {
        SceneManager.LoadScene(PlayerPrefs.GetInt("level"));
    }
}

Why is this not working?

for instantiating u have to specify : 1 - object that u want to instantiate
2 - position of your Object
3 - rotation of your object
in here u did not specify where and witch direction u want to instant your object
you can do it by: 1 - add and empty object and place it where you want your object to spawn
2 - add a [SerializeField] Transform instantPos;
3 - assign your empty object that you created to instantPos
4- and say Instantiate(button, instantPos, Quaternion.Identity);

Instantiate(character,Position, Quaternion.identity)

you can change the content according to you

(character = type of game object (object to instantiate))

(position = position of the object to be added to the scene. A variable of type vector3)

(Quaternion.identity resets the rotation values of the object to be added to the scene. For example, its values of 0.90.5 It makes 0.0.0)