#pragma strict
import UnityEngine.Networking;
class Queue extends NetworkBehaviour
{
var Car : GameObject;
var queueing : boolean;
var timer : GameObject;
var manager : GameObject;
function Start ()
{
ClientScene.RegisterPrefab(Car);
timer = GameObject.Find(“GlobalTimer”);
manager = GameObject.Find(“NetworkManager”);
}
function Update ()
{
if(Input.GetKeyDown(KeyCode.F2))
{
queueing = !queueing;
Debug.Log(queueing);
}
if(queueing == true && timer.GetComponent(RaceTimer).starting == true)
{
CmdSpawn();
}
}
}
function CmdSpawn()
{
var c = Instantiate(Car);
NetworkServer.Spawn(c);
Destroy(gameObject);
}
That’s my script but when I spawn the car , it doesn’t appear on both screens nor does it think it’s a “localplayer”? Any help?