Question by
j-alleaume · Jun 08, 2017 at 09:51 AM ·
networkingspawnprefabsclient
How can i Spawn a different prefab for client?
Hello,
I need help for my project, i use the network manager to spawn any prefab in a scene as a local host player. But i want to spawn another prefab for all client player who connect to the scene. I found that after several research but it spawn directly the prefab as a none player game object. How can i fix it?
public override void OnStartLocalPlayer()
{
if (this.isClient == true)
{
GameObject _playerPrefabs = GameObject.Instantiate (playerPrefab, transform.position, transform.rotation);
NetworkServer.Spawn (_playerPrefabs);
}
Thank you
Comment
Your answer
Follow this Question
Related Questions
Problem with instantiating and declaring objects in Netcode on client 0 Answers
Networking - How do i spawn an object with client authority? 1 Answer
Unet NetworkServer.spawn, correcting my workflow: Found no behaviour for incoming Command 1 Answer
Spawning Dynamically Created Object (Network) 1 Answer
Networking - Host can spawn objects but client cant 0 Answers