This is a bug introduced with 18468289 a while ago. We added this functionality for [Link Removed], which allows input event nodes to be placed within widgets and have them behave correctly.
This is all working well, except for the fact that the input delegates are never unbound. This obviously poses a problem if you have widgets who are regularly created/destroyed. We don't see this much in Lyra/FN because we hide/unhide the widgets rather then completely destroying them most of the time, but this is certainly a problem.
Proposed fix from user:
if(APlayerController* PC = GetOwningPlayer()) { if(PC->InputComponent) { PC->InputComponent->ClearBindingsForObject(this); for(int32 BindIdx = PC->InputComponent->KeyBindings.Num()-1; BindIdx >= 0; --BindIdx) { const FInputKeyBinding& KeyBinding = PC->InputComponent->KeyBindings[BindIdx]; if(KeyBinding.KeyDelegate.GetObject() == this) { PC->InputComponent->KeyBindings.RemoveAt(BindIdx); } } } }
I think that this is the "correct" solution, but I would prefer if we could add this functionality to `UInputDelegateBinding` via a "UnbindInputDelegates` function or something so that it can be used elsewhere. This may also get expensive for things with a lot of bindings, so we probably want to optimize it a bit.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-205313 in the post.
2 |
Component | UE - Editor - UI Systems - UMG |
---|---|
Affects Versions | 5.1 |
Target Fix | 5.6 |
Fix Commit | 35573495 |
---|
Created | Jan 30, 2024 |
---|---|
Resolved | Sep 30, 2024 |
Updated | Oct 9, 2024 |