Cast BP to its C++ class

I have MyChar C++ class and BP_MyChar based on it. I call GetOwner() from another cpp file, which returns BP_MyChar. How can I cast this result to MyChar Actor?

I tried AMyChar* Char = Cast<AMyChar*>(GetOwner()); but it fails to compile.

Hi Koldun,
just change it to Cast<AMyChar>(GetOwner()); - you don’t need the pointer…

1 Like

Oh, it did work… Thanks!

1 Like