Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug Start Client not instantiating Player prefab

Discussion in 'Netcode for GameObjects' started by lazy_clap, Oct 20, 2023.

  1. lazy_clap


    Jul 9, 2021

    im working on making a networked first person dodgeball game and i have set up my game with netcode for unity objects. i have my network manager and a separate menu scene where i have mirrored the functionality of the inspector buttons, start host and start client. These work fine, and i have validated this. I am able to create a host with no issues using a separate build and then when i click start client (even from within the inspector), my second player shows up in my host's game as expected.

    However even though the client is connected to the host, on the client's game (in my case the editor) there is no player prefab that has been instantiated by the network manager.

    To pre answer some questions i would ask if i was tyring to help myself:
    1.) Yes i create the host first, before i click start client
    2.) yes i have tried with both my menu start client button and the built in button in the inspector
    3.) yes the menu is on a separate scene, but again even on the client i can see scene switching is working as it loads my game scene
    4.) yes i have tried both ways around, as in starting client in the editor version and the build version

    I'm just not sure why it is connecting the client to the host but then not giving the client a player prefab to control. my understanding is that the network manager object spawns the player prefab in. This is how i am creating the player for the host so i don't see why it would be any different for the client, especially as far as the host game is concerned the client is connected.

    any help would be greatly appreciated