Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

using webserver to connect one user to one unity instance.

Discussion in 'Unity Render Streaming' started by tree_arb, Mar 2, 2023.

  1. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    321
    I'm using the multiplayer sample and only want one user per one unity instance (I know that sounds weird :)).

    I have it working this way:

    Start server > start unity instance1 > connect browser.
    >close server/ start server
    start unity instance2 > connect browser.
    >close server/ start server
    ...3rd, 4th etc...

    By doing this i can connect each browser user to one unity instance running simultaneously on the machine.

    What do I need to pass in to the server to to sync up an ID properly to not need to have to restart server?

    If I leave the server running, what happens is all browser users always ends up in the same instance unless i reboot server.

    I tried to disconnect instance1 from webserver by code once its running peer to peer. (methods inside websocketsignaling.cs) but it always disconnects the entire peer to peer connection as well which i don't want.


    I basically want to do what this user posted:
     
  2. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    803
    I guess you need to use "private mode" for this usecase.
    "Bidirectional" sample is a good example for this mode.
     
    tree_arb likes this.