UI Button OnClick Subscribable Event not Cancelable

I have a UI Menu which has several buttons (button_loud, button_regular, button_quiet). They are all subscribed to when the menu is opened. But I was looking for a way to Cancel the Subscribe to those once the menu is closed. Because I noticed that after testing it a few times, it seemed to be calling the function multiple times each time I pressed the button.
However, these UI buttons don’t appear to be “cancelable.”

You need to subscribe a single time when ui is built, you should not subscribe again every time the UI is opened…

And, to unsubscribe the function if needed for any other reason, you must call .Cancel() on the subscription result, such as:

MySubscription := MyButton.OnClick().Subscribe(ButtonClickHander)
# later on the code:
MySubscription.Cancel()

Thank you. That makes more sense. I appreciate your help.

Thanks :slight_smile:
If you don’t mind, can you mark this post as resolved to close it?