UNET moving client objects

Hi. I have an issue with new Networking system.

If I move object at the server side, it moves at the client side. When I move object at the client side, it DOES NOT move at the server side! What’s wrong?

Details:

Prefab has NetworkIdentity(LocalPlayerAuthority=true), NetworkTransform.

Script is derived from NetworkBehaviour.

Prefab is registered via Spawn Info in default NetworkManager.

Im creating new object via [Command] function which include:

  • GameObject newUnit = (GameObject)Instantiate…

  • [SyncVar] public NetworkInstanceId ownerId // in newUnit script

  • newUnit.ownerId = playerWhoSpawnedUnit.netId // to let unit find parent after its created.

  • NetworkServer.Spawn(newUnit);

Then on server and client this object is spawned and unit is placed as correct parent. But still only server movment is shared, moving unit on client side makes no changes on server

51796-1.png

PlayerMP is my Player Prefab for NetworkManager.
Im trying spawn new unit in Units for correct player

Add a NetworkTransform To the newUnit… to sync their positions and rotation over the network