Return Value Runtime Error

Hi everyone. I finally got a problem fixed but now ran into another problem. I have a widget button cast to the level bp with an event dispatcher. Ever time I click on the button everything plays just fine but when exit out I get a runtime error. However for some reason when I use a event begin play, it works with no problem! Can any please explain whats happening. Here are some screen shots.

266044-widget-bp-event.png

Do you destroy the vidget when you exit?
You can bind to event ONCE after the widget is created. Binding to it every tick is counterproductive, and I believe it is what causes the error. Your widget is destroyed, but you’re still trying to bind to its event.

Yes I did destroy the widget on exit although it’s not shown in this example. But would removing all widget be the same as destroying it? Also, if that’s the case I’m guessing I should get rid of Event Tick and if so, what else can I use to make sure the button the widget is click?

Hey thanks, you were right. Event Tick was the problem but now I’m trying to figure out what else I can use.

I think the problem is that you attach your “bind event” to tick function. it will attempt to make a new binding on every tick. which is totally wrong :slight_smile:

you can simply bind your event ( and should ) once and they will work until you unbind them.

the issue is that the value you are using for the binding is coming from another flow and it might not exist.

Thanks Plangton, you were right. It’s working fine now. Silly me on binding to the tick lol :D.