- Home /
SyncVar on objects in a list
If I have a list of objects, each holding a script containing a bunch of variables, what specifically needs to get marked as a syncvar or synclist in order to get sent to the server? I assume the variables need to be marked, but does the list of objects?
Answer by EpsilonQoppa · Jun 25, 2017 at 11:25 PM
Quote from: https://docs.unity3d.com/ScriptReference/Networking.SyncVarAttribute.html
The allowed SyncVar types are;
• Basic type (byte, int, float, string, UInt64, etc)
• Built-in Unity math type (Vector3, Quaternion, etc),
• Structs containing allowable types .
I get that only certain things can be syncvars and only certain things can be synclists, I'm more asking how they function. If I set that one list up as a sync list full of objects with syncvars on them will that all come through to the server in the same format
I'm not sure I understand. If you mean will a variable be received as the type it was sent, then yes.
If you want in-depth information on them, try this:
https://docs.unity3d.com/$$anonymous$$anual/UNetStateSync.html
I'm not doing great at explaining but I basically want to access the list of objects on the server exactly as I would were I just using them locally.
Your answer
Follow this Question
Related Questions
Why Does Adding to My SyncListStruct Break SyncVar? 0 Answers
How to Sync List 1 Answer
show sync var on two text ui (unet - networking) 3 Answers
Networking: how to sync complex objects 0 Answers
SyncList TO 3 Answers