How Do I Set Main Camera In C++ Like In Blueprint?

How do i set the main camera in c++ like done in this blueprint example (picture), this is something i really need help with asap


APlayerController has the function SetViewTargetWithBlend in C++, does the same thing as the Blueprint node for it.


Do you know what the code would be , i am a new to c++ thanks

Depends, do you already have a pointer to the player controller already? Can you give me some context of where you’re writing this C++ code?

i dont know i will show you what i am trying to mean

it is within the player.cpp