Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Instantiated Build Instance Questions

Discussion in 'Netcode for GameObjects' started by carbonroast, Mar 6, 2023.

  1. carbonroast

    carbonroast

    Joined:
    Sep 13, 2015
    Posts:
    1
    Hello,

    From my understanding, when I click on a button that runs NetworkManager.Singleton.StartHost();, my local machine becomes both the server and a client. Then I can go to file > build and run, get a 2nd instance and connect that instance as a client using NetworkManager.Singleton.StartClient();. All runs well, no errors. However if I use the "build and run" instance as the host and use my editor as the client, I get some errors. They usually state that only the server can do certain actions.

    Im a little confused, the build and run instance is suppose to be both the server and a client right?
     
  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hi @carbonroast , can you please post the scripts that are thrwing the errors, and the errors themselves? Without them it's hard to help you.

    In general, if you did things right, there should be no differences in how your game runs.

    Also, building every time you make a change is a time-consuming activity. I'd recommend to use Multiplayer Play Mode if you're on Unity 2023, or the ParrelSync package if you're on a lower unity version.

    You can find more info on this workflow here.