Why does Instantiate() code runs several times?

Hello, I’m new to Unity, and I want to generate a new clone when I press the Space key. However, when I press the button, it doesn’t make one; each time I press the key, it makes clones in geometric. This is my code.

public class NewBehaviourScript : MonoBehaviour
{
   
    // Start is called before the first frame update
    void Start()
    {
        
        
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space)){
           
            var itemGen = Instantiate(Resources.Load<GameObject>("Prefabs/Item1"));
            Debug.Log("b");
    }
  
}

And this is my capture:
[199700-캡처.png|199700]

As you can see in the log, it creates the instance more than once. How can I fix it?

Your “NewBehaviourScript” might be attached to multiple objets in Hierarchy. Otherwise I don’t see how this would happen. If you don’t find duplicate script then maby try making a new script and atach it to only 1 object.