SetViewTarget On Unpossess
I am currently writing a game where when the current pawn dies it should select a random camera actor in the level and set it as viewtarget until the player can respawn. Unfortunately I am running into an issue.
Easy as that
Here is the relevant code
All functions are called including SetViewTargetWithBlend in every occasion but there is no effect on screen. The camera stays in place where the pawn was unpossessed.
The function SetViewportToCamera works fine when called from other functions (See Code)
asked Apr 25 '19 at 12:06 PM in C++ Programming
I solved the problem
I had to set the bAutoManageActiveCamera in the PlayerController to false. Unfortunately this does not seem to be changeable at runtime. So I have to set the viewtarget manually whenever I possess a pawn.
Not a perfect solution, but still a solution.
answered Apr 27 '19 at 02:45 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here