Instantiate creates extra empty GameObject

I’ve looked through the forums to try to find an answer to this but I can’t find anything on it :s

When instantiating a prefab I seem to get an empty “New Game Object” appear in my scene along with the cloned prefab and I have no idea why. It’s not so much a problem, it’s just a strange behaviour.

Here’s what I’m doing :
(I’m not able to test this code right now so it may have some minor mistakes :P)

GameObject player = Instantiate( Resources.Load("playerPrefab"), Vector3.zero, Quaternion.Identity ) as GameObject;

When I look in the scene heirachy I get “playerPrefab (clone)” but also an empty “new game object”
the ‘player’ object in the code is properly assigned and functions correctly so like I said, it doesn’t cause problems.

Iv’e tried writing this in several different way but all give me the same result…

public GameObject playerPrefab; //Drag prefab here in inspector
GameObject player = Instantiate(playerPrefab, Vector3.zero, Quaternion.Identity);
Object[] playerPrefabs = Resources.LoadAll("playerPrefabs"); //Loads all resources from "Resources/playerPrefabs" into object array;
GameObject player = Instantiate(playerPrefabs[0], Vector3.zero, Quaternion.Identity);

and I’ve even tried not returning the instance in code, eg:

Instantiate(Resources.Load("playerPrefab"), Vector3.zero, Quaternion.identity) as GameObject;

Can anyone shed some light on this wierd functionallity?

Sounds like there’s a script on the player prefab that instantiates the object. Does this happen with any other prefab except the player?

Haha, yeah I think you’re right! ><
I just did a quick test on my lunch break and it seems to work as intended, I’ll need to check my code when I get home.
I should have checked that! lol
Thanks for the help!

Edit :
I have an old version of the project with me on a flash drive, and sure enough, here’s the culprit:

(From a script on the prefab GameObject)

    void Awake()
    {
        targetRotation = new GameObject();
    }