I'm developing an educational game whose main mechanics are not multiplayer-oriented. However, I would like to add a feature that allows the teacher to enter the game and all students can see him, but no student can see the other students. Is there a way to do that?
\$\begingroup\$ \$\endgroup\$
1 - 1\$\begingroup\$ If you know the ID of your teacher (even easier if you make them the master in a p2p game), then it should be easy to turn their avatar/model/character's renderer on and just not turn on the other players. I think if you have questions like this though, you definitely need to look into the architecture of networked games more though... \$\endgroup\$Mars– Mars2020-02-18 02:44:58 +00:00Commented Feb 18, 2020 at 2:44
Add a comment |
1 Answer
\$\begingroup\$ \$\endgroup\$
1 If one object (teacher) could be seen by others (students) - it is multiplayer game.
If you want to students couldn't see each other - this is details of realization of multiplayer game.
Therefore, yes, there is a way to do that:
Packets about teacher send to all students. Packets about students send only to teacher, but not to another students.
- \$\begingroup\$ This answer would be even better if it gave some guidance about how to control which packets get sent to whom in a Unity multiplayer game. \$\endgroup\$2020-02-18 10:26:29 +00:00Commented Feb 18, 2020 at 10:26