Inheritance and casting

I am stupid, please advise:

I have a character BP as a parent. It contains all the functionality code.
I have a character ABP as a parent. It contains the state machine etc.
I create children of the parent BP, and children of the parent ABP.
I use a child ABP in each of the child BP’s.

In each of the child ABP’s, Do I need to cast to the parent BP (base class) or the child BP which is using the particular child ABP I am casting from? In other words, In the child APB, do I use “cast to base class” (parent BP) or “cast to character” (Child BP)?

Also, when casting from the APB, should I use “get owning actor” or “try get pawn owner”

I really appreciate any guidance here. Thank You.

I decided to cast from my characters parent class, into the attached parent Animation BP
instead of the other way around, So the children should do the same.
According to the docs, this is the best way to set variables in the ABP as you shouldn’t use any logic in your ABP if you want best performance.

1 Like