SyncTypes
Host client limitations
// This example assumes you are acting as the host client.
// We will imagine previous value was 10, and next is 20.
private void _mySyncVar_OnChange(int prev, int next, bool asServer)
{
// If asServer if true then the prev value will correctly be 10,
// with the next being 20.
// If asServer is false then the prev value will be 20, as well the
// next being 20. This is because the value has already been changed
// on the server, and the previous value is no longer stored.
DoSomething(prev, next);
}Last updated