How to access the name of instantiated object?


i am making some codes in c# to instantiate a Gameobject but i want to know the name or tag of the instantiated object

so i can use

if ( == "the instantiated object")

//do something

is there anyway to do it?

try this

    //do something

or use tag

   //do something

I would create a temp variable that allows you to assess it instead of looking for it after the fact.

GameObject clonePrefab = Instantiate(prefabObject,transform.position,Quaternion.identety) as Gameobject = "new object's name" 
clonePrefab.tag = "objectstag"