Sending data from one object to another through server
This might seem like a silly question, but I can't seem to find an answer online maybe due to my wording or the specifics of what I'm looking for.
Basically I have a procedurally generated map, that map stores all of its information in a 2d array and then sets tiles based on that information, I set it up to be a server object with a photon view and all but I realized after that it still goes through its initial generation (because its in the awake/start function) which now also happens more than once (since it instantiates every time a player enters the game).
So basically how would I go about sending the 2 dimensional array I have between server/client so that I can set that information locally and not have a bunch of maps layered on top of each other.
There's other information I'd like to send but I'm sure I could figure that out once I have this sorted
Basically I have a procedurally generated map, that map stores all of its information in a 2d array and then sets tiles based on that information, I set it up to be a server object with a photon view and all but I realized after that it still goes through its initial generation (because its in the awake/start function) which now also happens more than once (since it instantiates every time a player enters the game).
So basically how would I go about sending the 2 dimensional array I have between server/client so that I can set that information locally and not have a bunch of maps layered on top of each other.
There's other information I'd like to send but I'm sure I could figure that out once I have this sorted
0
Best Answer
-
Actually, we got a sample which covers this. Check out the doc for the Procedural Demo (edit: it's part of the PUN 2 package in the store) and if there are follow-up questions, please continue here.0
Answers
-
Actually, we got a sample which covers this. Check out the doc for the Procedural Demo (edit: it's part of the PUN 2 package in the store) and if there are follow-up questions, please continue here.0
-
Ah, sorry for the confusion. It's in the package of PUN 2. Just get it in the Asset Store.0
-