Download

How do I correctly use spectator pawn in multiplayer?

If I understand it correctly, spectator pawn is supposed to only exist on local. It won’t replicate, nor should it exist on server at any time. In that case, how do I manually “posess” spectator pawn, since POSSESS function only works server side?

Here is how I implement it in my game.

  1. I enable “Start player as spectator” setting and set my custom specatator pawn class. So when the game starts, each player controller control its own spectator pawn only on local machine. Which is good.
  2. Now people decide to jump into action. The player will send a RPCServer request to spawn his in-game pawn and possess it. It looks like the old spectator pawn is automatically destroyed in this process.
  3. So the player now dies. How do I get him back into spectator mode? I tried to unposses the player controller. I tried to spawn a spectator pawn manually on client, but I cannot possess it so I can’t use it.
    The only way I can make it work is to spawn a spectator pawn and possess it server side. But then every client has a copy of it, which is not supposed to be like that. I imagine this is not a correct way to do so. So, my question is what is the correct way to re-enter spectator mode after player is killed?

Emmmh i did spawn it yesterday and posses it on server side and it worked best of luck buddy.

With that i want to say that then client posseses aswell. Well obviously that does not sound technical but just spawn it from server and posses you will see.

It works. But it turns out that it spawns a copy of it on every client. Even the ones still playing the game.
It shouldn’t work like that.