Casting Fail

So I’m making a CTF game and I have the Red player carrying the Blue flag and when he touches the Red flag, I want him to drop the Blue Flag and teleport it back to its original starting location, but when I cast to the Blue flag inside the Red Flag BP it fails every time.

Start of BP:

Where the CASTTOBLUEFLAG fails (Object is Other Actor of BeginOverlap):

FAIL Printed Onscreen:

I’m kind of confused on how casting works, I thought if the cast object is connected to the BeginOverlap that it should work

you are depending on the first RedFlag cast. if it fails nothing else will work, thats why you got a 2nd output Failed. basically, you are negating both logics, if it Casts succesfully to RedFlag and Casts succesfully to BlueFlag…do everything else.

Organize your BP a little more (the wires overlap way too much to understand which one comes from which), use sequence nodes (sequence 1 do the succesfull cast of redflag, sequence2 do cast to blueflag) and check again. if its still failing post a new screenshot.

What do you mean cast to RedFlag, there is no cast to RedFlag?
I first cast to RedGuy and get him to drop the object (which is the BlueFlag)
and then I cast to BlueFlag and am trying to get it to teleport
…but I am doing all of this inside the RedFlag BP.
I am confused as to where to put the sequence node, but here is me tidying up a bit

Also, I just had the idea that maybe I can set up the BlueFlag so that when it overlaps with the RedFlag, then it does all the checks and teleports the BlueFlag, all inside the BlueFlag BP instead of the RedFlagBP and by using ActorHasTag like I did to identify and specifying which object is overlapping.
Do you think that would be better than how I have it set up now?

you are right, there is no casting to redflag. however my point stands. you need to understand execution is linear. you are casting to redguy and then, at the same time, casting redguy to blue flag. so you are basically saying “is redguy also blueflag?”

if you want to compare if the blueflag is being overlapped (and thus, the flag is captured) you have to add the sequence node before comparing it to the redguy.

I am trying to first cast RedFlag to RedGuy and tell him to drop object and then after that I am trying to cast RedFlag to BlueFlag and teleport it back to start. They are separate but the casttoRedGuy has to go first because I need the Blue Flag to become separated from him before it is teleported back to start. So that was my linear thought process, but I guess the engine thinks I’m trying to casttoBlueFlag from RedGuy when I am trying from RedFlag. I think that’s what you are telling me.

So I put the sequence in but it still fails.

(I even switched around which cast is sequence 1 but that still resulted in a failure to cast)