Casting Failing when not using Overlap

I’ve tried looking and looking and looking and I can’t seem to find my particular problem anywhere. I’m probably doing something entirely wrong (if so I very much learned casting wrong then woops). I hope someone can give me some insight as to what’s going on.

So in my main character blueprint I’ve got some code where I’m trying to cast to one of my AI characters to get some info from it. If I cast to one of these AIs and connect ‘begin overlap’ to object, no issues. But if I connect ‘get player character’ to it instead it fails to cast entirely. Image below, but am I doing something wrong? I assumed this was how you cast, and it’s worked in the past but ever since moving to UE5.4 I have had non stop casting issues. Is it because I’m casting to another character BP inside my character BP? (I didn’t think this was an issue before in earlier versions?)

Edit
I can cast TO my main character in other BPs like from the AI one but if I try to cast to any other character BP IN my main character BP it fails.

Edit 2
So it’s casting to the AI characters’ BPs from anywhere that seems to be the problem. I have ‘BP_AIBearCub’ and ‘BP_AIBear’ and neither can cast to each other inside their BPs, nor can I cast to them in my main character BP.

You can either do that:

Or get a reference at the start with the Get All Actors of Class node, and use that.

They’re not the player character, you can’t use that there just because they’re character class BP’s.

Casting = test + conversion. You take an object and you check whether it is what you expect. If so, you can access this object’s data. Above you’re asking the engine whether the currently possessed player is an AI Bear Cub. They are not, judging by the description.

It’s not a problem with casting, casting is trivial - it’s about finding the reference to the object. How does the player character know which Bear you mean? How many animal companions are there? The player will be spawned by the Game Mode or placed in the level. What about the bears?

Okay I think I understand. Get all actors of class works though which is what I needed. I’m still very new to all of this, thanks!

I see where the issue might be then yeah. Alright, so I was casting sorta wrong problem. Wonder why I didn’t have issues in earlier versions… strange. Anyway thanks for the help! I’ll probably do some more research and learning into casting, I thought I had a grasp on it but guess not! Oops hah…