Orienting Spectator Camera to Different Perspectives while spectating other players

I am currently trying to implement a spectator pawn that can spectate characters stored within a list in the game state. I am currently able to spectate those characters in that list and switch between them but the functionality to swap perspectives between first/third/top-down is not working at all. Here are my blueprints:
Spectator Pawn BPs -
Imgur
Imgur
ThirdPersonCharacter BPs and Viewport -


Imgur
Imgur

Any help is appreciated!

We did this by making the FirstPersonSpectator and ThirdPersonSpectator their own characters. Then you Possess() one or the other with SpectatorPlayerController() when switching spectate mode.

Its a bit more effort but nicely separates code / blueprint so much more readable / manageable.

I’m not sure I’m completely following what you’re describing. Could you further explain how you would keep the FirstPersonCharacter and ThirdPersonCharacters location and camera in sync with the player they are spectating?

Depends on what networking model you are using. If using Unreal standard replication you could probably just attach the spectator to the spectated character. If using some 3rd party networking (that’s what we do) then interpolate the spectator based on incoming transforms of the character being spectated.

How would you set up those interpolations based on incoming transforms? Within a tick event inside the spectator pawn?

There are many way to do it, but the basic idea is every Tick():

  • read incoming messages
  • farm the messages out the appropriate actors
  • interp the spectator camera

We use FMath::VInterpTo() FMath::RInterpTo() and it is quite smooth interpolation even with a 10 HZ update rate.