Download

difference between Cast to Character Class and Cast to Character

Hi! I’m new. Can anyone explain to me the difference between both? Especially “Cast to Character Class”. I don’t understand when and how to use “Cast to Character Class”. Thank you!!!

In programming a Class is a static, IE non changing, template of something, but is not a concrete real thing. An instance is the concrete real thing created from the class. The class defines the structure, the instance makes it real.

One way to think about it is a class is a cookie cutter, and the cookies are instances.

Can you give some examples when to use “Cast to Character Class” in Blueprint? In the tutorials I see ppl only use “Cast to Character”.
Say if I create a character blueprint called “mycharacter”. In other blueprint I can have a node “cast to mycharacter” and “cast to mycharacter class”. And inside “Cast to mycharacter class” I can choose all blueprint include mycharacter blueprint. That’s why I confuse. Looks like “Cast to mycharacter class” is just an extra step of “Cast to mycharacter” only.

It all depends on what you need. Casting to the Base class will give access to its members. But if you have a BP that inherits from the base class which has additional members that you want to access, you have to cast it to the BP.

If I’m correct, you would cast to your character class if you wanted to reference any of it’s members (other characters) that are in existence.

A class is just what it says a class. Like as in ‘Cast To Mr. Jones’ Class’ would mean ‘Anybody in Mr. Jones’ Class’. A character is more specific.