I want to build a system that when the character dies, the dead character can spectate another character that is still alive. Now I know that in the PlayerController class, there is a function called SetViewTargetWithBlend…This works well if I don’t destroy the character. However, I want to be able to destroy the character after the character dies.
So my question is, how can I accomplish the same thing as SetViewTargetWithBlend while destroying the dead character at the same time?
Thanks for your reply. Unfortunately, this solution does not work. Camera does not follow another living player. It just stays at the point the character died.
You need to create a spectator class. On death the server (game mode) spawns the spectator class and you possess it.
You then simply get a list of all simulated proxies on the client. Each will represent a living player. You can then either set view target with blend or simply attach your camera to the sim proxy of choice.