- Home /
Sync an arraylist of game objects - Unet
I'm an absolute beginner. I'm working on a traffic simulator with unet which in my implementation resembles a multiplayer game with different vehicles as clients. I now want an arraylist of game objects to be synced across all the clients whenever it is changed (something like a shared data structure). I've read somewhere that syncvars don't work on collections. Is there a simple and efficient way to handle this or should I use commands and Rpcs explicitly?
Answer by meat5000 · Mar 06, 2018 at 10:04 PM
I do believe it is possible to SyncList. Massive connection hog if you want to do that for a whole list at a reasonable frequency.
Oh. I'll check the documentation out. I don't think lag would be an issue because I intend to put less than 5 - 6 elements in it at any given time. Will it though?
I think I used it once, maybe on a List of structs to do something like this. Worked fine. However I'm not sure that you'll quite get what you intended. Syncvars were made exactly for this purpose.