# Event not working with "Cast failed"

**URL:** <https://forums.unrealengine.com/t/event-not-working-with-cast-failed/385257>\
**Category:** Blueprint\
**Tags:** casting, cast-failed, unreal-engine, question, Blueprint\
**Created:** [February 17, 2017, 5:21pm UTC](https://forums.unrealengine.com/t/event-not-working-with-cast-failed/385257 "2017-02-17T17:21:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mister\_P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mister\_P](https://forums.unrealengine.com/u/Mister_P)\
**Post date:** [February 17, 2017, 5:21pm UTC](https://forums.unrealengine.com/t/event-not-working-with-cast-failed/385257/1 "2017-02-17T17:21:12Z")

</div>

Hello,

I have an object (the Circle) that I want to be grey when not in focus, and green when in focus.  
So resulting to a LineTracebyChannel and BreaHitResult, I casted it into the wanted object (the circle is called BP\_Menu).

 ![126720-sans+titre-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/2/a429d653541f0fec293c5c08d721946e09d93281.jpeg)

I want to have two events : “on focus” and “not on focus” but the problem is that if the first one work (when casted to the object, it result in activating the event in the second graph), the second resulting in “if cast fail” doesn’t seem to be activated in the second graph, even though you can see it’s activated on the first graph…

I tried several solutions but couldn’t find something working. (Working with blueprints is still new for me)

So can you please help me to have my two events working ?

Regards,  
Pierre

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_87d82eb9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_87d82eb9](https://forums.unrealengine.com/u/anonymous_user_87d82eb9)\
**Post date:** [February 17, 2017, 5:44pm UTC](https://forums.unrealengine.com/t/event-not-working-with-cast-failed/385257/2 "2017-02-17T17:44:48Z")

</div>

you are trying to run the ‘pas en focus’ event through a reference to ‘BP menu’ that doesnt exist, because the cast failed.

---

<div class="post-metadata">

**Author:** ![Mister\_P](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mister\_P](https://forums.unrealengine.com/u/Mister_P)\
**Post date:** [February 17, 2017, 8:47pm UTC](https://forums.unrealengine.com/t/event-not-working-with-cast-failed/385257/3 "2017-02-17T20:47:41Z")

</div>

Oh, I see now, I think I misunderstood how the ‘cast to’ element worked 😕 Thank you for your response, I’ll find another way to do it.

---

<div class="post-metadata">

**Author:** ![Sephy\_Muspellheim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sephy\_Muspellheim](https://forums.unrealengine.com/u/Sephy_Muspellheim)\
**Post date:** [February 5, 2018, 3:32pm UTC](https://forums.unrealengine.com/t/event-not-working-with-cast-failed/385257/4 "2018-02-05T15:32:20Z")

</div>

Question:I have a similar issue, only action events won’t fire regardless of whether the cast is successful or not, any idea?

Like I have input rotate, if i conduct a cast, whether it fails or succeeds, i cant use this input, but if i specify a key int he blueprint,that works, do you know why this is?
