x

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. 

Accesing a Variable from UMG to Class Blueprint

  1. I have created a public integer Variable called UI_Int in UMG with default value of 0.

  2. On button click I am setting UI_Int value to 7

  3. How do I access the value of UI_Int in my class blueprint

Although I have gone through some similar questions in the forum about blueprint communication, I still not able to get it right. Could you please help me out possible with images.I am new to this and am really interested to learn it.

Product Version: UE 4.7
Tags:
more ▼

asked Aug 19 '15 at 11:28 AM in Blueprint Scripting

avatar image

AmitAnandDey
24 8 12 13

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

1 answer: sort voted first

You can grab the variable from a widget using casting. Drag the blue dot from the widget's return value and type in your variable name. alt text

alt text

uiint.png (56.9 kB)
uiint2.png (63.9 kB)
more ▼

answered Aug 19 '15 at 01:38 PM

avatar image

AaronPaulina
79 7 8 9

avatar image AmitAnandDey Aug 20 '15 at 04:50 AM

Thank you so much AaronPaulina.You made my day!!:)

avatar image AmitAnandDey Aug 20 '15 at 06:26 AM

Hi AaronPaulina,

After trying your said method I am only able to get default value of variable(UI_Int) which is 0.How do I get its value as 7 once the button is clicked.

This is what I want

  1. create a variable (UI_Int) in UMG and set its value to 0 (I am able to do this)

  2. On button click change it value to 7 (I am able to do this)

  3. Return UI_int value as 7 in my class blueprint (which is returning 0 currently instead of 7)

Am I missing something in your earlier comments? Appreciate your help Thank You

avatar image jtsmith Aug 20 '15 at 07:50 AM

store the widget into a variable rather than simply dragging off the create node like shown above. After the variable is changed, grab the reference and pull off that to get the "UI Int" value. Pulling the value before you change it will give you default.

avatar image AmitAnandDey Aug 20 '15 at 09:02 AM

Thank you jitsmith. It worked

(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