# Boolean not casting properly inside UMG Blueprint

**URL:** <https://forums.unrealengine.com/t/boolean-not-casting-properly-inside-umg-blueprint/420401>\
**Category:** UI\
**Tags:** boolean, unreal-engine, editor, UE4, Blueprint, question, UMG\
**Created:** [March 21, 2018, 12:07am UTC](https://forums.unrealengine.com/t/boolean-not-casting-properly-inside-umg-blueprint/420401 "2018-03-21T00:07:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![StrangeLove13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StrangeLove13](https://forums.unrealengine.com/u/StrangeLove13)\
**Post date:** [March 21, 2018, 12:07am UTC](https://forums.unrealengine.com/t/boolean-not-casting-properly-inside-umg-blueprint/420401/1 "2018-03-21T00:07:50Z")

</div>

Hi! Im trying to cast a simple Boolean that I set in my character blueprint to my UMG to let my widget know when my key is no longer held, so that it can destroy itself. However, the Boolean in the UMG seems to disregard how it’s set in the character BP, and gets set to True in the UMG blueprint regardless. What am I doing wrong?

I would like to set up my blueprint in a way that the Widget would destroy itself without finishing when I let go of the input key, I haven’t had much luck in achieving this yet.

I’ve uploaded my blueprints here so its easier to see

> **[Character BP posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4](https://blueprintue.com/blueprint/ywkusxjc/)**
>
> No description provided

> **[Widget posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4](https://blueprintue.com/blueprint/nvr8r7f3/)**
>
> No description provided

 ![234485-widgetbp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/a/7ea1404a7d85ae99a1444d64ef69f6829e718003.png)

 ![234486-characterbp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/6/7060bc7ca4624d0a03dd5e4b14ba236899fc8541.png)

 ![234487-nzcddap.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/4/db428c6f692df65ce5e8a820057d2a9de7211be8.jpeg)

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [March 21, 2018, 1:29am UTC](https://forums.unrealengine.com/t/boolean-not-casting-properly-inside-umg-blueprint/420401/2 "2018-03-21T01:29:40Z")

</div>

That boolean is only checked once when the UMG widget is FIRST created. So unless at the very moment you “create” the widget you are also holding the space bar this will never be true. What you want is something more like a custom function or an event dispatcher to fire off an execution chain once space bar is released/pressed however works with your logic.

---

<div class="post-metadata">

**Author:** ![StrangeLove13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StrangeLove13](https://forums.unrealengine.com/u/StrangeLove13)\
**Post date:** [March 21, 2018, 3:27pm UTC](https://forums.unrealengine.com/t/boolean-not-casting-properly-inside-umg-blueprint/420401/3 "2018-03-21T15:27:31Z")

</div>

I got it to work with custom events, thanks!
