Widget Problems. Widgets sometimes don't create.

Hello everyone,

I’m having a temperamental issue with widgets. I have made a simple yes or no type survey. Sometimes it works all the way through and sometimes it will get stuck and not load the next widget. My blueprint is simple enough.

On Button Click > Remove from Parent > Delay 2.0s > Create Next Widget > Set Variable Object Reference for next widget > Add to Viewport.

In the new widget it does this: Event Construct > Play Animation. Then I will have the same to get to the next widget.

I have already tried using delays for different times and/or in different locations, setting a separate command string for each button but it keeps repeating the same behaviour. Sometimes it all works, sometimes it will not load the next widget randomly and get stuck. It stops on loading different widgets, its not the same one every time.

The widget yes or no survey has 15 widgets total.

Is there a better way to do this? (Widget Switcher) (Child - Parent System)

(EDIT: something just occurred to me as I was posting this, if a widget animation sequence doesn’t finish before its removed, will that cause it to not load the next one? I have tried either way and its still random. Just wondering if that may cause this issue sometimes, but not all times)

1 Like

I don’t see how anything can run after ‘remove from parent’, because the widget is ready for garbage collection then :slight_smile:

1 Like

Each widget is only used once. So either " Remove from parent " or " Remove all widgets " works for me. I could try " Set Visibility → Hidden " instead and then on the last widget remove all widgets and/or garbage collection.

I will try some more combinations on see what happens.

Remove from parent is being called on the object that’s holding the code you’re trying to run :slight_smile:

1 Like

Thanks for the help. You are right in what you said, nothing should be able to run after you remove from parent. For some reason it was working most of the time, which is why I didn’t understand that it was the problem.

I have replaced the “remove from parent” nodes with “set visibility” to hidden. Also added a “collect garbage” node on the last one. It all seems to be working fine now.

Thanks again.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.