Unable to control prefab when spawned from Network Manager.

I have been fiddling with solutions on this one for a few days without success. I have a prefab set up in the Network Manager’s “Registered Spawnable Prefabs” section. However I keep getting errors when I try and spawn it.

77623-regspawnprefabs.png

This is the function that spawns the prefab.

#pragma strict
import UnityEngine.Networking;

public class SpawnScript extends NetworkBehaviour {

private var piecePrefab : GameObject;
public var pcId : int = 2000;

    function NetSpawn () {
		var piecePrefab : GameObject = Instantiate(Resources.Load(pcId.ToString()));
		NetworkServer.SpawnWithClientAuthority(piecePrefab, connectionToClient);
    }
}

However when I run it it doesn’t run as client or authority. Here is the Network Information.

77624-netcomponents.png

And these are the errors I get when I try and spawn the prefab:

Error 1:

There is no NetworkIdentity on this object. Please add one.
UnityEngine.Networking.NetworkBehaviour:get_connectionToClient()
SpawnScript:NetSpawn() (at Assets/Standard Assets/2D/Scripts/SpawnScript.js:286)
$:MoveNext() (at Assets/Standard Assets/2D/Scripts/SpawnScript.js:62)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Error 2:

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Networking.NetworkBehaviour.get_connectionToClient () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkBehaviour.cs:25)
SpawnScript.NetSpawn () (at Assets/Standard Assets/2D/Scripts/SpawnScript.js:286)
SpawnScript+$Start$23+$.MoveNext () (at Assets/Standard Assets/2D/Scripts/SpawnScript.js:62)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

Any help would be greatly appreciated. Thank you in advance.

Update:

I was able to move the function (as is) to another GameObject, however the network information is still off and I still cannot control it.

#pragma strict
import UnityEngine.Networking;

public class Player extends NetworkBehaviour {

	public var pcId : int;
	function NetSpawn () {

		var piecePrefab : GameObject = Instantiate(Resources.Load(pcId.ToString()));
		NetworkServer.SpawnWithClientAuthority(piecePrefab, connectionToClient);
	}

	function Update () {
	
	}
}

The Player Network Information:

77640-player.png

The Prefab Network information:

77642-prefab.png

what gets me about this, is the Player controller ID is -1 and the GameObject its attached to has Player Controller ID is 0. I don’t know why its doing this. Any help is GREATLY appreciated.