How to move the CameraComponent into PlayerController
until now I added an UCameraComponent to the character class the way it was done in the TPSTemplate or in the battery tutorial, I am not sure. I just added a UCameraComponent to the character, and it was selected and used - I have absolutely no idea why, it was a local component variable I created.
Now I try to move the camera to an own PlayerController class, as it should be attached to the player, not to the character. (The possessed pawn can change and I don't want every MyCharacter instance to have a camera - it is used for npc-s as well). However I failed to activate it.
This is how I tried:
If I start the game I have the same default camera I would without this extra code. Any idea what's wrong or how to achieve my goal?
Well, the PlayerController component overwrites the function which is used by the Actor class instances to get the data from the camera component.
An other Actor here would search for camera component if bFindCameraComponentWhenViewTarget is set. I suppose it's not a bug but a feature, but... I don't really see why can't this work in the same way it does with other actors.
I suppose there isn't a reasonable way to store a CameraComponenet in the PlayerController then.
answered Jun 15 '15 at 09:24 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here