Add Controller Pitch/Yaw to Child Actor Component Camera doesn't work.

The boardgame player characters (“MainCharacterBP_BoardGame”) in my party game have a multitude of custom camera actors (“CharacterCamBP”) which I’ve added as child actor components, which allows me to have much better camera control, and also allows for easier camera transitions using Set View Target with Blend, however, here is the problem.

If the player wishes to change from an overhead camera (“OverheadCam”) to a traditional 3rd Person camera (“ThirdPersonCam”), where the player can use the mouse or right stick on a gamepad to move the camera around like a 3D Platformer, the “Add Controller Pitch Input” and “Add Controller Yaw Input” do not effect the current view target (A CharacterCamBP Child Actor Component called “ThirdPersonCam”).
Add Controller Yaw/Pitch/Roll Input only works when an active SpringArm+Camera is a direct component of MainCharacterBP_BoardGame, however due to a number of reasons, I want to get rid of the SpringArm+Camera components (I’ll explain one reason below).

I have tried going into the “CharacterCam” blueprint, and trying a variation of settings for “Use Pawn Control Rotation”, “Inherit Pitch” and “Inherit Yaw”.
I have also tried a bunch of crazy other things to no avail.

So I’m wondering, am I missing something incredibly obvious here? The only difference between the existing springarm and camera that I’m using, and the CharacterCam, is that the CharacterCam is a child actor component.

As for the reason why I am getting rid of the SpringArm+Camera components, it’s due to an issue that has plagued the game since the very beginning, and that is the camera manager automatically switching camera whenever a new player controller is created.
If there is a character with a Camera component anywhere in the level, and the CreatePlayer function is called, the camera automatically switches to the origin of player 0, or if there’s no player, it will go to the origin of the level.
I have disabled “AutoManageActiveCamera” in the player controller, and edited the PlayerController.cpp to change “AutoManageActiveCamera” default value from True to False.
I know that the work-around solution to this is to get a reference to actor who was the last view target, and set it as the view target immediately as a new player controller is created, but I like to understand where these problems occur and fix them, not work around them as it can get very messy.

Any thoughts on either of these problems?

Any help would be greatly appreciated.

Thank you all in advance.

The question is still relevant, however I will share how I have worked around the issues for now.

I have left the SpringArm+Camera components on the MainCharacterBP__BoardGame, but made it so straight after adding controller Yaw/Pitch input, the ThirdPersonCam’s Springarm’s RELATIVE rotation is set using the MainCharacterBP_BoardGame’s Control Rotation (“Get Control Rotation” node).

As for the problem with camera switching, I’m storing whatever the current view target is in the Game Instance (since the issue only occurs locally), and whenever a GamePad connects and a Player Controller is created, on BeginPlay of the new Player Controller I am setting view target back to the one stored in the Game Instance.
This only seems to work after a 0.01s delay…I don’t like using Delay nodes for things like this, but it’ll suffice for now until I have a better solution.

I did a bit of a deep dive into the source code to try and figure out where this camera switching is occurring, and I have a few ideas, but I’m yet to actually do any tests to narrow it down specifically.

Anyway, I just thought I’d share that with anybody who comes here however many days or years later…I know it’s not SUPER helpful, but hopefully someone will find some use of it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.