Instantiate as GameObject

Target = Instantiate (TargetPrefab, TargetInstantiationPlace.position, Quaternion.identity) as GameObject;

This was my code for instantiating a target game object.
However in the inspector I do not see it. There is no ‘Target’ Game Object in the inspector, only target(Clone).
So, it’s the same result as if I just used

Instantiate (TargetPrefab, TargetInstantiationPlace.position, Quaternion.identity)

without

as GameObject;

and without giving it a name.


What am I doing wrong?

Thank you.

Your ‘Target’ is a variable name, not a game object’s name. ‘target(Clone)’ is the name of the gameObject which was instantiated and can now be accessed through the ‘Target’ variable.
If you want to set the name of the instantiated object, you have to add one line of code, for example:

Target.name = "Target";