Hi! When i move an obj on the server, it moves on the clients. But, when i move it on the clients, it does not move on the server. How do i fix this? I have the object as a prefab with the Network Identity script, Local Player Authority checked, and a Network Transfrom script on it set to Sync Transform.
same issue here:
- 1 player prefab using network identify, network transform.
- auto spawn player prefab on server and on client
result:
- player transforms on client is mirrored on server instance
- player transforms on server are not mirrored on client instance.
Any luck anyone?
use a [ClientRpc] to set the transform information on the client from the server:
public struct TransformInformation
{
public float x;
public float y;
public float z;
}
class myClass : NetworkBehaviour
{
[ClientRpc]
void RpcSetTransform(TransformInformation ti)
{
gameObject.transform.position = new Vector3(ti.x, ti.y, ti.z);
}
}