How do I refer to the name of the game object the script is attached to?

I have clones of various objects spawning in but I need to refer to the individual objects in their scripts once they spawn in. How do I assign the names of the game objects to the string in their own scripts?

public string nameOfBlock; GameObject thisBlock;

You can just type gameObject in the script to reference the GameObject it’s attached to.

    nameOfBlock =;

It’s that easy.