Hi guys!
Hoping you can help me with a little something. I have created a save/load script, and it works great for saving/loading by pressing buttons. Now I want to make it automatic, and I can’t really figure it out.I wanted to run the Save() function when a player disconnects, so I tried this:
public override void OnClientDisconnect(NetworkConnection conn)
{
base.OnClientDisconnect(conn);
print("Client disconnects");
Save();
}
However, this needs to derive from : NetworkManager, and I already have another script that derives from NetworkManager, and you can only have one script that does that.
So I tried having this other script that derives from NetworkMangager access the Save() function from the first script, but I can’t make that work either.
Can anyone tell me how to run my Save() function when a player disconencts from the server? (Multiplayer game)
Actually, I can’t even get this to work:
public override void OnClientDisconnect(NetworkConnection conn)
{
base.OnClientDisconnect(conn);
print("Client disconnected");
}