Search Unity

generetator maze in runtime with peer to peer

Discussion in 'Multiplayer' started by Bolt, Apr 28, 2016.

  1. Bolt

    Bolt

    Joined:
    Dec 15, 2012
    Posts:
    296
    I created a script that generates a runtime maze. What I want to do is simulate networking with peer to peer technology already set on unity. How can I make sure that the labyrinth generated by the server is the same who see clients?
     
  2. srylain

    srylain

    Joined:
    Sep 5, 2013
    Posts:
    159
    Synchronize the seed that you used to generate the maze by making it a SyncVar, and then use that to generate the maze on each client.
     
  3. Bolt

    Bolt

    Joined:
    Dec 15, 2012
    Posts:
    296
    in the settings I have not SyncVar. This component is connected to a vacuum GameObject that generates the maze
     

    Attached Files:

    • sync.png
      sync.png
      File size:
      17.7 KB
      Views:
      683
  4. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294