Why does my cast fail

Hello there,
I really need some help 'cause I’m tired of this cast. Usually, when a cast doesn’t work, I always find an alternative.
But this time, I tried to do a cast with another ActorBP and this cast always fails. I don’t know what to do…
Could someone help me ?

What it means is the thing you’re casting is not of the type you’re trying to cast to.

Can I see the code?

I used an event on ‘component begin overlap’ to see if another actor overlap it
I don’t know if I’m clear
You have the screen on the original post

so what i suppose to do in this case ?

i’m only interesed to know if the UnbreakableVolumeBP and the CaisseBp are overlapping if not, I don’t need to do anything

did i need to have a specific collision presets on the overlappded actor ?

Ok, sorry missed the picture.

Ok, so something overlaps. You check if it’s an UnbreakableVolumeBP. If it is fine, if it’s not, you check if it’s a caisseBP. If it is, the off to the right, otherwise:

It’s neither of these things.

You have the code right, it’s just the thing that’s overlapping isn’t either of those things you’re checking. Does that make sense?

It means something is overlapping with the volumne which is neither of these things. Which gives you two questions:

  1. Does it matter? ( sometimes you’re only interested in some things )

  2. What else could be causing the overlap?

Actually #2 is what we cast on overlap in the first place. If you’ve got an overlap volume that operates a door for your player, you don’t want the door opening every time a bullet flies past. That’s why we cast and check it actually is our player walking into the volume.

So you’re ok then… :slight_smile:

No, another reason why it’s worth casting.

did you know another reason why a cast can fail in this case ?

In all the blueprints in all the world, there’s only one reason why the cast fails. Because the reference you’re casting is not of the type you’re casting to…

Sorry but i didn’t understand how work the cast.
To cast a actor bp what did i need to do ?

thanks for all the time you spend to help me. I gonna try to understand.

Sorry, I’ve explained it all above…