I'm trying out the new Unity 5.1 networking for a Bomberman style game and i can't seem to get the bombs to instantiate on both the client and all those connected, what am i missing?
The code below instantiates a prefab at the players current position, that prefab has a Network Identity and a Network Transform same as the players, i thought if the object is spawned using "NetworkServer.Spawned(Object)" then that would be instantiated on both clients?
// Update is called once per frame
void Update()
{
if (isLocalPlayer)
{
this.transform.Translate(new Vector3(Input.GetAxis("Horizontal") * speed * Time.deltaTime, Input.GetAxis("Vertical") * speed * Time.deltaTime, 0.0f));
if (Input.GetKeyDown(KeyCode.Space))
{
GameObject item = Instantiate(prefab, this.transform.position, Quaternion.identity) as GameObject;
NetworkServer.Spawn(item);
}
}
}