I have no idea what I’m doing wrong but it’s driving me insane!
I have a simple scene with a NetworkManager to which I’ve assigned a Player Prefab ‘TestPlayer’. The object is a simple cube to which I’ve added a NetworkIdentity and a NetworkTransform which is configured to sync transform.
I use the Network HUD to host/join a server.
The problem I’m having is that the transform of player prefab owned by the server is synced to the clients but not vice versa. I’ve also added a movement script ‘NetworkDude’:
using UnityEngine;
using UnityEngine.Networking;
public class NetworkDude : MonoBehaviour {
void Update() {
if(GetComponent<NetworkBehaviour>().isLocalPlayer) {
var x = Input.GetAxis("Horizontal") * 0.1f;
var z = Input.GetAxis("Vertical") * 0.1f;
transform.Translate(x, 0, z);
}
}
}
Any clues to what I’m doing wrong?