# Button OnPressed delegate triggered twice when dynamically constructed

**URL:** <https://forums.unrealengine.com/t/button-onpressed-delegate-triggered-twice-when-dynamically-constructed/2689888>\
**Category:** UI\
**Tags:** unreal-engine, slate, CPP, UMG\
**Created:** [January 6, 2026, 6:55am UTC](https://forums.unrealengine.com/t/button-onpressed-delegate-triggered-twice-when-dynamically-constructed/2689888 "2026-01-06T06:55:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kotaru\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kotaru\_1](https://forums.unrealengine.com/u/Kotaru_1)\
**Post date:** [January 6, 2026, 6:55am UTC](https://forums.unrealengine.com/t/button-onpressed-delegate-triggered-twice-when-dynamically-constructed/2689888/1 "2026-01-06T06:55:26Z")

</div>

So I have a UUserWidget derived class in c++ that contains a UButton derived class. Within this UButton derived class, I also replaced RebuildWidget with the construction and assignment of my own SButton subclass, which I assign to MyButton.

Inside this UserWidget, I create the UButton in RebuildWidget, with a if(!MyButton) guard around it. I then bind to its OnPressed delegate in NativeConstruct().

For some reason, this triggers OnPressed twice. OnClicked still only triggers once, but OnPressed triggers twice.

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![Subressor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/subressor/32/1112012_2.png) [@Subressor](https://forums.unrealengine.com/u/Subressor)\
**Post date:** [January 6, 2026, 3:14pm UTC](https://forums.unrealengine.com/t/button-onpressed-delegate-triggered-twice-when-dynamically-constructed/2689888/2 "2026-01-06T15:14:10Z")

</div>

everything you’ve described here doesn’t really point to why this gets triggered twice. i’m not sure if you’ve also called the parent’s construction functions which also bind the delegate so if you find bound the delegate twice then when it receives the on pressed input hooks it may be firing both delegates going to one pressed?

As a workaround, you can put in a do-once node or a anti-double-press spam prevention. So it’s a sort of very short timer ball loop function. So even if you get the double-click for on-pressed.

on click is down and up so even if the on pressed input down receives two inputs you need a down and an up input for the clicked to register.

---

<div class="post-metadata">

**Author:** ![Kotaru\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kotaru\_1](https://forums.unrealengine.com/u/Kotaru_1)\
**Post date:** [January 6, 2026, 5:20pm UTC](https://forums.unrealengine.com/t/button-onpressed-delegate-triggered-twice-when-dynamically-constructed/2689888/3 "2026-01-06T17:20:42Z")

</div>

Well I specifically need pressed and released to trigger separate logic, for things like held buttons and such.

Again, the very odd thing is that I bind on native construct, and my breakpoint on `CustomButton->OnPressed.AddUniqueDynamic(this, &UMyWidgetClass::OnPressed_Forward);` it gets tripped once when starting PIE.

However the bound function gets triggered twice somehow. My slate button `Pressed` is only triggered once when I press it as well. I mean I have to wonder if its related to how slate handles inheritance. I overrode `RebuildWidget` without calling the parents function, however I wonder if the parents implementation is somehow still being executed here and creating a normal SButton that’s getting bound?

---

<div class="post-metadata">

**Author:** ![Kotaru\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kotaru\_1](https://forums.unrealengine.com/u/Kotaru_1)\
**Post date:** [January 6, 2026, 6:21pm UTC](https://forums.unrealengine.com/t/button-onpressed-delegate-triggered-twice-when-dynamically-constructed/2689888/4 "2026-01-06T18:21:53Z")

</div>

okay so more specifically, when pressing the button it seems to immediately press and release, then press again

---

<div class="post-metadata">

**Author:** ![Kotaru\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kotaru\_1](https://forums.unrealengine.com/u/Kotaru_1)\
**Post date:** [January 6, 2026, 6:34pm UTC](https://forums.unrealengine.com/t/button-onpressed-delegate-triggered-twice-when-dynamically-constructed/2689888/5 "2026-01-06T18:34:28Z")

</div>

I wonder if it has something to do with this bit of UButton:

```auto
FReply UButton::SlateHandleClicked()
{
    OnClicked.Broadcast();

    return FReply::Handled();
}

void UButton::SlateHandlePressed()
{
    OnPressed.Broadcast();
    BroadcastBinaryPostStateChange(UWidgetPressedStateRegistration::Bit, true);

}

void UButton::SlateHandleReleased()
{
    OnReleased.Broadcast();
    BroadcastBinaryPostStateChange(UWidgetPressedStateRegistration::Bit, false);
}

void UButton::SlateHandleHovered()
{
    OnHovered.Broadcast();
    BroadcastBinaryPostStateChange(UWidgetHoveredStateRegistration::Bit, true);
}

void UButton::SlateHandleUnhovered()
{
    OnUnhovered.Broadcast();
    BroadcastBinaryPostStateChange(UWidgetHoveredStateRegistration::Bit, false);
}

```

I mean OnClicked is the only one that doesn’t have `BroadcastBinaryPostStateChange`, so maybe with how unreal handles managing the pressed state doesn’t play nice with subclassing

---

<div class="post-metadata">

**Author:** ![Kotaru\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kotaru\_1](https://forums.unrealengine.com/u/Kotaru_1)\
**Post date:** [January 7, 2026, 4:26am UTC](https://forums.unrealengine.com/t/button-onpressed-delegate-triggered-twice-when-dynamically-constructed/2689888/6 "2026-01-07T04:26:44Z")

</div>

okay disregard all of this. It was actually a mishandled switch statement I used to call the parent press implementation in SButton. I just swapped it out with if/else ifs to avoid any potential issues with it, and the issue went away
