I'm trying to Sync data from the client to the server using the new Unity Networking, and I'm failing for some reason.
I've set up a prefab with a NetworkIdentity
component with the attribute Local Player Authority
set.
I (manually) spawn that on the server, and it is correctly propagated to the clients.
I have a couple of vars on this class, which the client sets and the server should read:
public class PlayerController : NetworkBehaviour
{
[SyncVar] public bool engineOn;
[SyncVar] public Quaternion lookAt;
The client correctly sets them, however the server never receives them, they always stay at the default value.
What might be happening?
Command
, but I would like to understand if I can get it to work usingSyncVar
. \$\endgroup\$