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.
- 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.
- 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.
- 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?