Question by
kyrcooler · May 22, 2016 at 06:08 PM ·
multiplayer-networkingspawningclient
Spawning a gun for a client doesn't work
So I spawn players and than guns that they have, on a host it works perfectly but on a client guns do not become instance of an object. Here's the code
[Command]
void CmdSpawn() {
gun = (GameObject)Instantiate(gunToEquip, weaponPosition.position, weaponPosition.rotation);
NetworkServer.SpawnWithClientAuthority(gun, connectionToClient);
gun.transform.parent = weaponPosition;
}
Comment
Your answer
Follow this Question
Related Questions
Non-host client doesn't seem to have authority when running Command 0 Answers
Projectile not rendering for client when moving too fast 0 Answers
Spawning GameObject on network, locally change it only on the client that spawned it. 0 Answers
Client Spawning Player Objects 0 Answers
[UNET] Spawn object on server BUT delete on your client 1 Answer