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"

Widget text not updating

Hi everybody, here what I'm tryng to do: - I click on an object in my level - It appears a menu with three buttons - Clicking the buttons I change the object and set values for two variables - if I go on pause I can see the values of the two variables shown in a box

how I've done:

In the widget "Menu_PopUp_A2" I set different values at the two variables "PA_Scritta" and "PA_Price" depending on which button I'm clicking In the widget "Pause_Menu" I created two text variables "Testo-A" and "Price-A" and bound to two different boxes as content; the value of the two text variables is set at the event construct by the two cast variables "PA_Scritta" and "PA_Price" (converted in text)

What's the problem: Since I'm setting the two text variables at the event construct of the widget, the boxes should be always updated when I add to the viewport the widget, but it works only the first time I add it and then remain fixed on the value of the first time!

Don't mind to the warning of the "cast to" in the "Menu_PopUp_A2" screenshot: in theory I've done all right and practically works perfectly without problems

I'm a real newbie so I'm sorry if my question is dumb but even looking at "parallel" tutorials (like the inventory one) I'm not figuring what is missing or what I'm doing wrong!

alt text alt text alt text

Product Version: UE 4.10
menu_popup_a2.png (290.7 kB)
pause_menu.png (218.3 kB)
more ▼

asked Dec 02 '15 at 04:48 PM in Blueprint Scripting

avatar image

40 9 16 18

avatar image De Ocean Pirate Oct 26 '16 at 02:34 PM

Does your cast to need to be a direct link? I.e. a variable that the variable type is "the blueprint it wants to access". So If I a ma human and want to speak to a robot, my variable type needs to be "a robot" and then link that to your robot blue print from your human blue print.

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

1 answer: sort voted first

AddToViewport does not call the constructor. AddToViewport takes an already existing widget and makes it visible within the HUD.

In MenuPopupA2:

When the OnClicked(A1_Button), OnClicked(A2_Button), and OnClicked(A3_Button) events execute, the branch from Event Construct is not fired and GetAllActorsOfClass->Get[0]->CastToBP_Ottoman do not execute.

In order for those nodes to execute after OnClicked, you need to place them within the execution branch of those events; but what you should really do is Set the variable once in Event Construct; and then Get the variable value during each OnClicked event.

In PauseMenu:

You're calling RefreshPriceA every tick; you only need to call this when the prices/display changes. Calling every tick is a bit much; especially when you're calling "GetAllWidgetsOfClass" to pull the 0 index widget every frame.

more ▼

answered Oct 26 '16 at 02:53 PM

avatar image

1.7k 43 12 61

(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