Possess a pawn and use static camera?
Hello, I am attempting to do two things: 1) Control a Pawn that can fly around, and 2) Look through a camera not associated with that pawn (static camera).
I've looked all over, couldn't find anything, I know there are other questions like this one, please help, etc. etc... I think it's because I'm using C++. My problems are:
1) The pawn in question won't possess the moment I hit the "play" button, even though it is set to "Default Player Start."
2) When I click "possess" I can control the pawn, but the viewport shows it as if it was a first-person view from the pawn, NOT the static camera.
What am I missing? And how, if possible, do I change it with C++?
In UE4 pawn possessing and view targeting are 2 separate mechanisms, but by default for easiness, player controller set possessed pawn as view target in same time. You can disable that by setting this variable in PlayerController to false:
This variable is also binded in blueprints and you can set it there too. After that you posses and set camera sepretly, you set view target using this function (which is also in blueprint)
Now here C++ exclusive feature, view target is a actor which camera manager asks about camera position ("From what position you want to be viewed?") by calling ClacCamera function:
Default code in AActor class picks position of first active camera component in actor (so in blueprints you can control camera by activating and disableing camera components), you can change this behavior (and don't use camera components at all) by overriding this function in actor that you gonna set as view target.
Follow this question
Once you sign in you will be able to subscribe for any updates here