NetworkTransform on Scene Object not working

Hi,

First of all, I’m using Unity 5.6.0f1 (with a Unity Plus license).

I’m trying to sync the transform of a scene object between every clients, but it only works from the local client/host to the clients.
The game object has a NetworkIdentity and a NetworkTransform.

When the host moves the game object, the transform is synced on all clients.
But when a client (not the host) moves the game object, the transform is not synced on any clients.

Can you help me out?

Thanks a lot.

Generally speaking almost everything is synced from Server → Client. In your case the client is able to change the transform’s position, but no data is sent from Client → Server.

The only cases where NetworkIdentity data is sent from Client → Server is if the client has authority of the networkedObject. Because those scene objects are controlled by the server the client has no authority of them. NetworkTransform will never send data from Client → Server even if the client changes it’s position.

Does the client moving the object have authority over the object?

He said they are scene objects, so no I don’t believe the client will have authority.

I only think things like SpawnWithClientAuthority, AssignClientAuthority, or AddPlayerForConnection give authority.

In that case, is it possible to give authority of the networked object to multiple clients ?

No, I believe only 1 client can have authority. If you want multiple clients to be able to act on 1 object I suggest using MessageBase to send data to the server. Then you will have to code on the server how to handle the fighting between clients that are all trying to control the same object.

Thanks,
I solved it by assigning local authority when the object is picked up by a player, and removing the authority when the player releases the object.

Hello BoraxKid

I know this is an older thread but can you share your code for doing this? I am having a similar issue…

Thanks

Important … for 2018 …

we determined

There is some flakiness with NetworkTransform if you are using localhost during development, perhaps particularly on Mac.

it’s a real PITA. Be sure to test on normal LAN with a few machines.