Instantiate cloning problem

I am having trouble with the Instantiate command. I have a script that is supposed to replace the object what it is a part of with anther, and it works! put for a little bit because it is creating clones and then clones of clones and so on and so forth until it no longer can place them
8463302--1123850--clone.png
and this is probably the culprit
8463302--1123853--culprit .png
I don’t know why this is happening
put here is the code

using Unity.Mathematics;
using UnityEngine;

public class Lever_slfedistract : MonoBehaviour
{
    public GameObject ON;
    public GameObject OFF;
    private Vector3 vector3;
    private quaternion quaternion;
    private void Awake()
    {
        vector3 = transform.position;
        quaternion = transform.rotation;
    }
    public void Lever_ON()
    {
        Instantiate(OFF,vector3,quaternion);
        gameObject.SetActive(false);
    }
    public void Lever_OFF()
    {
        Instantiate(ON, vector3, quaternion);
        gameObject.SetActive(false);
    }
}

what I am trying to do is to make it flip back and forth between the two prefabs every time the player click on them and the click detection is done but I am have trouble with the flipping. ty

Why Instantiate? Why not just have an ON and an OFF lever, put them in the scene, drag references to them into your script and set them active / inactive when you want?

thank for commenting. it’s because I am going to make anther script that counts how many are on and how many are off so it increases or decrease the points accordingly; and also because I am new to game development so I’m not very experienced on what to do or in the various commands
so if you have any suggestions or tips i wood love to hear them.

I’d make a lever script, make a prefab out of it that contains both on and off, put it in a blank scene and test it until the script works.

Then apply the prefab, go to your main scene and put as many of them around as you want.

Once you’ve gone that far you can make a script that counts them and asks if they’re tripped on or off easily enough… tons of tutorials on basic C# list handling.