0
\$\begingroup\$

SyncVar and RPC calls allow a UNET server to send messages to clients, but these messages are not triggered if the server-side change comes from the inspector or a custom editor (and presumably any non-MonoBehaviour).

EG I use the inspector to change a SyncVar - only the server is updated. Or press a CustomEditor button which calls a method marked with Target/ClientRpc - it will just execute that method on the server.

What is the best way to call UNET networking functions from Inspector GUIs and non-MonoBehaviour code?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

When using a SyncVar, a network change can be triggered by adding a custom Editor with a field of the same type. This editor can then set the syncvar property to match the editor value when it change, which lets network updates trigger as normal.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .