- Home /
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
PlayerMP is my Player Prefab for NetworkManager. Im trying spawn new unit in Units for correct player
Answer by SoftAnswers · Aug 26, 2015 at 08:26 AM
Add a NetworkTransform To the newUnit.... to sync their positions and rotation over the network