37 lines
1.5 KiB
Markdown
37 lines
1.5 KiB
Markdown
# Unity Setup
|
|
First, set the ip of the csnc compatible server.
|
|
|
|

|
|
|
|
Then schedule the GameObjectRegistry script to be\
|
|
(Go To: Edit / Project Settings / Script Execution Order)
|
|
|
|
|
|

|
|
|
|
|
|
then add the CSNC prefab to your scene
|
|
|
|
from here you can add references to the models that you want to synchronize across projects as per the image
|
|
|
|
(these are references to models that will be shown on the client, but controlled by another players client)
|
|
|
|

|
|
|
|
take note that the objects are children of the CSNC prefab and they are not enabled
|
|
|
|
in addition to this, the objects under CSNC have NO behaviour scripts attached to them, this is important because it may cause desynchronization if you dont know what you're doing
|
|
|
|
## Client Controlled GameObjects
|
|
|
|
Now that you have set up CSNC you can start adding client controlled GameObjects
|
|
|
|
it is quite trivial to add new Client Synchronized GameObjects, simply attach the "Client Sync Behavior" component to the gameobject you want to sync
|
|
|
|

|
|
|
|
As you can see, the client sync behavior is attached to the gameobject and given the id "razorblade" \
|
|
(remember what you entered earlier from when we set up the game object registry)
|
|
|
|
### Congratulations!!
|
|
And thats it!! once you have set this up the two gameobjects will be synchronized across clients (assuming you have set up the server - side) |