Hi everyone. 2 Days ago I started learning verse and I am working through the Epic tutorials. I am following this tutorial Coding Device Interactions The problem is that even though I copied and pasted the code exactly nothing gets added to my array and I can run the event multiple times. Is this happening to you as well or am I missing something , maybe a setting somewhere else ?
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.