Hey everyone, I’m looking for a little help with a part of my game. Attached is a screenshot of the blueprint of my quiz widget. There are 5 questions, each one has two check boxes, one for Yes and one for No. On the event, it goes through and checks that at least one box is checked. This seems correct, but for some reason this isn’t working and is always defaulting to false even if both boxes are checked. Theoretically the OR boolean would go true as long as one is check right? Why would this not work?
Looks correct as long as you have at least 5 checkboxes checked across all 5 answers. And you haven’t mislabeled the widgets. Are you sure the event is triggered? When is it triggered?
You can also send the output of all OR nodes into a single AND node and feed that to a single branch node. But what you have should be equivalent.
Here’s a recording of the entire blueprint and widget. As you can see the paper BP just gets an interaction and then casts to the widget to test for the boxes. Once in the widget, it goes through all the checks (I cleaned it up with your advice ty!) and then T/F sends back to the paper whether it’s finished or not. As you can see at the end of the clip, each time I interact with the paper it gives me an Accessed None error for each checkbox. I don’t understand why it’s not able to access it. Each box is a variable, though I can’t seem to make them public if that’s necessary or not.
Try enabling Edit tab → Editor Preferences → Experimental → Blueprints → Blueprints break on exceptions. Might give you a better idea of the error.
My guess is that you’re using the widget component directly with a default value. However, it is created dynamically.
So if you want to use the widget in a widget component, you can’t set a default value. You have to use WidgetComponent->GetUserWidgetObject and use that. You can set it in a variable on BeginPlay I think.
So in BeginPlay event assign Widget Control variable the output of Widget (Component)->GetUserWidgetObject and try it again.
Changing the variable to be the widget object worked! Thank you so much for the help!
Right on! Glad it worked. I ran into this exact same thing when I started using widget components way back when.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.