Widget Button not Working

Hello. I have been making a maze that generates a number of rooms based on length, width, and height variables. I have been able to generate the maze on BeginPlay using the editable variables. I have been trying to generate the maze through the use of a widget. The widget has three text boxes and a button. The idea is for the user to enter a number in each box (for length width and height) and press the button to generate the maze. I set it up so that on button pressed, the text is found, then converted to string, then integer. Then it sets the mazes variables to the final integers and calls a custom event in the maze. When begin play is used to start the maze, it works fine. With the custom event it doesn’t work. When I enter the text and press the button the maze doesn’t generate. When looking through the blueprint it would seem that the button event was never called.

so your clicking the widget button but its functionality isnt being run or it isnt calling an event in bp. show us your code so we can see what youve done and so we can have a more clear picture of what your saying.

if your situation is press button then that calls a event in another bp then i would say you dont have a good reference to the other bp. if everything is being done in the widget well then theres a issue with your code and we will need to see it to help.

Here are my blueprints.
On BeginPlay my character checks it’s Box component for the maze and creates a reference from it. I set up a print string to the Cast Failed and got nothing, so I think the cast works.

In my widget I cast to the player and get their maze reference. Then set the maze’s variables to the user typed numbers and calls the maze’s custom event.

This is the start of the maze blueprint with the receiving end of the custom event.

264610-mazebp1.png

These are of the widget in play test and design.

264631-widgeti1.png

264632-widgeti2.png

Does the cast succeed from the button press or does it fail? You press the button and cast to player character does that succeed? And if so does the function actually get called? Like will a string print from within the maze generation function?

I found out that the issue was with the maze reference. I set up a cast node using the reference to cast to the maze. I set up a print string and found that all the casts were failing. I was also getting this note with the cast node. Why would the cast fail if the reference is the same thing?

264635-wdgetbp2.png

It’s not failing it is just telling you that is an unnecessary cast. Just go direct from “maze reference” to whatever you are doing…no need to recast to CustomizableMaze3D

The casting was just to test whether the reference worked. I use print strings and found that all the numbers worked and that it did make it to the sending half of the custom event but not to the receiving half.

I found this question and was able to get my widget working by using it.