How to "double instantiate" an object and have all players receive reference to that

Basically, what I want is that when one player instantiates an object (PhotonNetwork.Instantiate), all other clients should spawn an extra object which should persist to all users, and each user should have a reference to which object caused this new object to spawn. For example, if there are 4 players, player one spawns an object. When players 2,3,4 see that a new object is spawned, they spawn an object on their own so now the scene has a total of 4 objects. This is easy to do, but I dont know how I can save a reference to them. e.g Dictionary > where OtherSpawns are the other objects instantiated due to this object

Answers

  • edited April 2019
    Oops I meant Dictionary(FirstSpawnObject, List(OtherSpawns) )
  • Whenever you Instantiate, you get a reference to the new object. You just need some place to store that, essentially.
    Did you find a solution?
Sign In or Register to comment.