Spawned prefab only shows on the server client, not on other clients.

So I’m trying to add bullets to my 2D game, and I used this tutorial, but my bullets only show up on my the client hosting the game. Here is my a screenshot of my bulletprefab inspector:

and this is my Network Manager Object’s Inspector:

lastly, this is the code I have on my player for shooting:

if (Input.GetMouseButtonDown(0))
        {

            CmdShoot();
        }
    }
    [Command]
    void CmdShoot()
    {
      
        if (netFacingRight == true)
        {
         
            GameObject bulletInstance = Instantiate(bullets[0], bulletSpawn.position, bulletSpawn.rotation);
            bulletInstance.GetComponent<Rigidbody2D>().velocity = bulletSpawn.transform.right * 10;

            NetworkServer.Spawn(bulletInstance);

        }
        if (netFacingRight != true)
        {

            GameObject bulletInstance = Instantiate(bullets[0], bulletSpawn.position, bulletSpawn.rotation);
            bulletInstance.GetComponent<Rigidbody2D>().velocity = bulletSpawn.transform.right * -10;

            Vector3 SpriteScale = transform.localScale;
            SpriteScale.x = -1;
            bulletInstance.transform.localScale = SpriteScale;

            NetworkServer.Spawn(bulletInstance);

        }
    }

As I said, every single player can shoot, but only the host can see the bullets, and he can see his own AND the other clients’. But the clients can’t even see their own bullets.

Any help is appreciated, and if someone wants me to provide more info or upload the entire project, please let me know. Thanks!

A quick look shows that it seems like you have Server in the NetworkIdentity. Try Local Player Authority

1 Like

But my Player shouldn’t have control over the object, it should only be spawned on the server, with server authority, synced to clients?

I’ll try to give it a shot when I come home though :slight_smile: