# Script for a Widget Button

**URL:** <https://forums.unrealengine.com/t/script-for-a-widget-button/426721>\
**Category:** UI\
**Tags:** bind, unreal-engine, Widget, question, Blueprint\
**Created:** [June 5, 2018, 6:30pm UTC](https://forums.unrealengine.com/t/script-for-a-widget-button/426721 "2018-06-05T18:30:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiviviki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kiviviki](https://forums.unrealengine.com/u/Kiviviki)\
**Post date:** [June 5, 2018, 6:30pm UTC](https://forums.unrealengine.com/t/script-for-a-widget-button/426721/1 "2018-06-05T18:30:50Z")

</div>

Is it possible to bind a “shooting” script on a button for an example. There must be a way to use script from character blueprint on a button or do I have to make the button in some different way.

I tried custom events, but the won’t work correctly on buttons, because i can’t fill all the “shooting” script on a custom event.

I’m trying to transfer my game from Windows to android and I’m not going to use joysticks, cause they are terrible to use on android.

Please help!

---

<div class="post-metadata">

**Author:** ![simonuks221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@simonuks221](https://forums.unrealengine.com/u/simonuks221)\
**Post date:** [June 12, 2018, 5:01pm UTC](https://forums.unrealengine.com/t/script-for-a-widget-button/426721/2 "2018-06-12T17:01:47Z")

</div>

I would use custom events. Could you please explain why they dont work correctly for you?

---

<div class="post-metadata">

**Author:** ![Kiviviki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kiviviki](https://forums.unrealengine.com/u/Kiviviki)\
**Post date:** [June 14, 2018, 4:52pm UTC](https://forums.unrealengine.com/t/script-for-a-widget-button/426721/3 "2018-06-14T16:52:06Z")

</div>

I have input axis value connected and i can’t get it to custom event. I created new movement script for the buttons.

Now i have another problem. When i die, movement buttons are disabled, but i can still move if i keep holding the button through death, but if i release, i can’t press the button anymore and not able to move. “disable input” doesn’t work because buttons doesn’t use inputs.

---

<div class="post-metadata">

**Author:** ![simonuks221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@simonuks221](https://forums.unrealengine.com/u/simonuks221)\
**Post date:** [June 14, 2018, 5:43pm UTC](https://forums.unrealengine.com/t/script-for-a-widget-button/426721/4 "2018-06-14T17:43:56Z")

</div>

Well, for the death button problem you could just remove that widget from parent and quickly add it to viewport again, it would reset the widget and fix your problem.

---

<div class="post-metadata">

**Author:** ![Kiviviki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kiviviki](https://forums.unrealengine.com/u/Kiviviki)\
**Post date:** [June 14, 2018, 6:34pm UTC](https://forums.unrealengine.com/t/script-for-a-widget-button/426721/5 "2018-06-14T18:34:08Z")

</div>

Well, i thought it would work, but it didn’t.  
Atleast trying in viewport using mouse.

---

<div class="post-metadata">

**Author:** ![Kiviviki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kiviviki](https://forums.unrealengine.com/u/Kiviviki)\
**Post date:** [June 14, 2018, 8:03pm UTC](https://forums.unrealengine.com/t/script-for-a-widget-button/426721/6 "2018-06-14T20:03:30Z")

</div>

Fixed it by destroying “Character Movement Component”
