ButtonSubscription := Button.InteractedWithEvent.Subscribe(OnButtonInteractedWith)
# Add the cancelable result to a spot in the Subscriptions array.
CPrint(“Hello”)
if(set Subscriptions[0] = ButtonSubscription):
CPrint(“Subscribed to the Button’s InteractedWithEvent and set the subscription in Subscriptions!”)
else:
Print(“Sub failed”)
If you add an else statement, you will see the array is failing to initialize. The code does compile without error but adding or accessing values from an array is a failable expression and it is definitely failing. If I can figure out why, I will update. One solution is to just get rid of the array for now, so you can see how the button event and the cancel sub function works. The array is not required for that functionality.