Hi,
I’m trying to create a simple multiplayer game in Unity. I decided to use MLAPI but I have some smaller and bigger problems due to lack of informations about this new module.
In order to create a game I need to set some Networked variables that will be synchronized across all players to keep some world related informations (eg. whose turn is currently). To do that I was trying to use NetworkedVariable in my custom NetworkManager but without results. Same when I was trying to do that in my GameManager.
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Networking.Match;
using MLAPI;
using MLAPI.NetworkVariable;
public class MyNetworkManager : NetworkManager
{
NetworkVariableInt test = new NetworkVariableInt(new NetworkVariableSettings { WritePermission = NetworkVariablePermission.Everyone }, 10);
public void PrintValue()
{
Debug.Log(test.Value);
}
public void Increase()
{
test.Value = test.Value + 1;
}
}
Can anyone point me to the correct approach to solve this problem?
I was looking for some examples and tutorials but i found only informations about creating players. That doesn’t solve my problem.