Hey, i’ve been playing around with c++ and there are two things i don’t get.
So the other half of this is the PlayerController. You can think of it as the actor that actually represents you the player. When it possesses the pawn, a bunch of interaction occurs between the pawn and the controller which eventually leads to binding that pawns camera to the controllers player view. So basically the camera is auto detected when your controller attaches to the pawn.
Thank you!
Have i gotten this right then; The base class of the PlayerController ask the pawn possessing it if the pawn has an object that is a subclass of UCameraComponent?
It’s related to the view target. You cantransition between view targets from Blueprints (or using the SetViewTarget function directly in C++). When the game starts, it must set the view target to the player by default.
Thanks! But what i still don’t get though is why it works, seeing as I was the one who added the PlayerCamera pointer and the 3 lines in the cpp file are the only times its referenced.
The engine doesn’t know or care about your pointer, it knows about the camera because all components are automatically registered with the actor they’re attached to. It’s this registration system that lets the player controller know there’s a camera on this actor.