Search Unity

Multiplayer game with different kinds of players/enemies

Discussion in 'Multiplayer' started by Maklaud, Sep 5, 2018.

  1. Maklaud

    Maklaud

    Joined:
    Apr 2, 2013
    Posts:
    551
    Hi All!

    I'm new to multiplayer games and learning it with this set of articles - https://unity3d.com/ru/learn/tutorials/s/multiplayer-networking

    In the step 3 we create a player prefab. If I understand it correctly, it means that all connected players will be of the same type, say, two tanks (player and enemy), two cars (player and enemy) etc.

    But what if I want to have totally different players? Say, cat and dog, hunter and duck etc. That is, player and enemy with TOTALLY different properties and behaviour. One player plays as a hunter, another player plays as a duck. Maybe it will be covered in those articles later, but I'm not sure, so I decided to ask it in advance.

    Thanks!
     
    Last edited: Sep 5, 2018
  2. Maklaud

    Maklaud

    Joined:
    Apr 2, 2013
    Posts:
    551
    No advice? I beleive it should be possible to implement. Like other games, where you can play as a sniper or as a doctor...
     
  3. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    Some possibilities...
    • You can add multiple prefabs, each representing a different class type and spawn those as needed.
    • Or you can use one prefab which uses a syncvar to ascertain which class it is at any particular time. Changing it would result in the required alteration to the model etc...