added network movement

This commit is contained in:
DerTyp187
2021-10-21 14:21:11 +02:00
parent 9f66155cd7
commit ebf1078775
8 changed files with 392 additions and 34 deletions

View File

@@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MLAPI;
using MLAPI.NetworkVariable;
using MLAPI.Transports;
using MLAPI.Messaging;
using TMPro;
public class PlayerNetworkingScript : NetworkBehaviour
{
public NetworkVariableInt dice = new NetworkVariableInt(new NetworkVariableSettings
{
WritePermission = NetworkVariablePermission.ServerOnly,
ReadPermission = NetworkVariablePermission.Everyone
});
private void Update()
{
if (Input.GetKeyDown(KeyCode.J))
{
Debug.Log("J");
NetworkManager.Singleton.StopHost();
NetworkManager.Singleton.StartClient();
}
}
}