Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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.

Product Version: UE 4.20
more ▼

asked Jan 08 '19 at 04:42 PM in Blueprint Scripting

avatar image

Timothy LeBlanc
14 2 2 6

avatar image ThompsonN13 Jan 08 '19 at 04:52 PM

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.

avatar image Timothy LeBlanc Jan 08 '19 at 05:08 PM

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. alt text 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. alt text This is the start of the maze blueprint with the receiving end of the custom event. alt text

These are of the widget in play test and design.

alt textalt text

playerbp1.png (103.5 kB)
widgetbp1.png (193.4 kB)
mazebp1.png (65.1 kB)
widgeti1.png (14.0 kB)
widgeti2.png (119.3 kB)
avatar image Nebula Games Inc Jan 08 '19 at 06:40 PM

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?

avatar image Timothy LeBlanc Jan 08 '19 at 07:07 PM

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? alt text

wdgetbp2.png (52.6 kB)
avatar image Nebula Games Inc Jan 08 '19 at 07:10 PM

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

avatar image Timothy LeBlanc Jan 08 '19 at 07:16 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I found this question and was able to get my widget working by using it. https://answers.unrealengine.com/questions/203513/cant-call-event-from-another-blueprint.html

more ▼

answered Jan 09 '19 at 01:15 PM

avatar image

Timothy LeBlanc
14 2 2 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question