Download

Help me understand why this works

I just finished the Unreal 3rd person BP tutorial, and everything works great… However, I noticed something when going back in to play around with the blueprints.
This little bit in the image here controls the camera movement. What I’m trying to understand is WHY it even works since target is self. As I understand it, *self *refers to the entire BP. So how does the BP know that my intention is to rotate the camera around the character, and not simply rotate the character into a superman pose when I look down?

https://s20.postimg.cc/40nbn3dkd/mouse_look.jpg

Those are methods(functions) in the base APawn class.
You can right click on the nodes and click “goto definition” to see them.

HTH

Ahh I see, so it’s a default behavior for the pawn class. I just wasn’t sure if I activated a feature somewhere and wasn’t aware of it. Thanks for your guidance.

By the way, the right click and view docs feature does not work on any blueprint nodes for me. It works fine on material nodes, but is grayed out on any blueprint node I click on. Am I missing something here?

I have the same result, Wonder why that is.

At least the tooltip from hovering the mouse over the node gives a (quick) description.
I also mostly go to the code definition and use C++ as the documentation.

When you make a character BP from the Character class it will have the following inheritance tree

  1. Actor
  2. Pawn
  3. Character
  4. BlueprintCharacter

Self is all of those. Self refers to the object instance and since it is a BlueprintCharacter it will reveal all the functions in the inherited classes if they are Public or Protected.
Inheritance is also referred to as a is-a relationship. A BlueprintCharacter is a Character who is a Pawn who is a Actor.

Composition is also used. The character class e.g has a capsule component attached which has its own functions like SetCapsuleRadius. Composition is referred to as a has-a relationship. A Character has a capsule component and a Character has-a Skeletal Mesh component e.g.

…and the character, who is-a pawn, has-a camera component, so just follow the chain of inheritance/composition. Got it.
Now it makes more sense as to why ryan20fun was directing me to the pawn class in the docs for the behavior on the camera. I’m too new to question anyone’s advise, so I just did as I was told. hehe :smiley:

Thanks for the additional insight.

@cgcodycg

Maybe or Yes and No, as this feels like only half the story…:p… Its worth considering that although Character inherits from Pawn they are worlds apart, especially when Character-Movement-Component is used. CMC is a vast unwieldy piece of functionality that includes client-server prediction and replication too. So its quite removed from Pawn. That’s why the nodes in the original screenshot feel obfuscated, because CMC really is a black box regarding Blueprints… Whereas if you were working at Pawn level, its likely you’d be controlling far more things manually, from Camera behavior to Movement etc…

Indeed the CMC is doing a ton of things. The implementation code of the CMC alone is more than 10.000 lines.

In that case I wonder if building a character manually from a pawn class would be a better learning opportunity, so as to better understand what the CMC is doing for me automagically.

I’m not a fan of automation when learning. I’ll be lazy when I know what I’m doing. lol