# Why does my cast fail

**URL:** <https://forums.unrealengine.com/t/why-does-my-cast-fail/462916>\
**Category:** Blueprint\
**Tags:** actor, unreal-engine, fail, cast, Blueprint, question\
**Created:** [March 26, 2020, 9:36pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916 "2020-03-26T21:36:55Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gekos011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gekos011](https://forums.unrealengine.com/u/Gekos011)\
**Post date:** [March 26, 2020, 9:36pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/1 "2020-03-26T21:36:55Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 26, 2020, 9:54pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/2 "2020-03-26T21:54:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Gekos011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gekos011](https://forums.unrealengine.com/u/Gekos011)\
**Post date:** [March 26, 2020, 10:10pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/3 "2020-03-26T22:10:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 26, 2020, 10:17pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/4 "2020-03-26T22:17:00Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Gekos011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gekos011](https://forums.unrealengine.com/u/Gekos011)\
**Post date:** [March 26, 2020, 10:33pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/5 "2020-03-26T22:33:00Z")

</div>

so what i suppose to do in this case ?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 26, 2020, 10:36pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/6 "2020-03-26T22:36:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gekos011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gekos011](https://forums.unrealengine.com/u/Gekos011)\
**Post date:** [March 26, 2020, 10:47pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/7 "2020-03-26T22:47:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 26, 2020, 10:48pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/8 "2020-03-26T22:48:00Z")

</div>

So you’re ok then… 🙂

---

<div class="post-metadata">

**Author:** ![Gekos011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gekos011](https://forums.unrealengine.com/u/Gekos011)\
**Post date:** [March 26, 2020, 10:55pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/9 "2020-03-26T22:55:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 26, 2020, 11:20pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/10 "2020-03-26T23:20:46Z")

</div>

No, another reason why it’s worth casting.

---

<div class="post-metadata">

**Author:** ![Gekos011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gekos011](https://forums.unrealengine.com/u/Gekos011)\
**Post date:** [March 27, 2020, 5:00pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/11 "2020-03-27T17:00:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2020, 5:33pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/12 "2020-03-27T17:33:38Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Gekos011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gekos011](https://forums.unrealengine.com/u/Gekos011)\
**Post date:** [March 27, 2020, 6:01pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/13 "2020-03-27T18:01:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [March 27, 2020, 6:04pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/14 "2020-03-27T18:04:24Z")

</div>

Sorry, I’ve explained it all above…

---

<div class="post-metadata">

**Author:** ![Gekos011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gekos011](https://forums.unrealengine.com/u/Gekos011)\
**Post date:** [March 27, 2020, 6:25pm UTC](https://forums.unrealengine.com/t/why-does-my-cast-fail/462916/15 "2020-03-27T18:25:49Z")

</div>

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