- Home /
Question by
EarthdragoN · Apr 25, 2018 at 02:38 PM ·
c#multiplayerserverside
Coop network functionality
Hello everyone!
I am currently working on a small coop game which should be played with two people. To make my work easier I use the Network Lobby from the asset store. What I need now is to save those two players to a list or something to be able to adress them individually. My solution is to use a LobbyHook, which doesn't seem to be the best solution, as it is done on both, client and server.
public class SimpleLobbyHook : LobbyHook {
private List<Player> players = new List<Player>();
public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lp, GameObject gp) {
Player player = gp.GetComponent<Player>();
players.Add(player);
}
}
Is there a possibility to access the connected players individually with another method? As I need to spawn those two players at a fixed location for each: is there a possibility to write a custom spawn method?
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Code Wont Work? 0 Answers
Multiplayer Gun Script 0 Answers