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. 

How to get a variable value from a c++ class to display as an UMG text block

So a few days ago I started making a user interface for my school project. I cannot seem to get a variable value to display in a text block. In the binding I look for all the actors that use UserInterfaceManager. In my current scene, this is only one actor. I then try to return a float using the GetCurrentSpeed method. My widget and c++ code both compile, but my text is always set to 0.0, when it should be 5. Even when I hardset Speed to any other number, it always displays 0.0. Any idea what I'm doing wrong here?

alt text alt text alt text

Product Version: UE 4.21
Tags:
h.png (66.1 kB)
cpp.png (62.7 kB)
bind.png (122.4 kB)
more ▼

asked Mar 21 '19 at 06:24 PM in Blueprint Scripting

avatar image

opgeturnt af
1 1

avatar image MrMcKvarz Mar 22 '19 at 02:01 PM

You need to connect GetText0 block to the GetAllActorsOfClass block.

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

1 answer: sort voted first

Wow you're a legend. Don't know why I didn't try that. You helped me big time. I connected GetText0 to GetAllActors and connected GetCurrentSpeed to the return node. It now works!

more ▼

answered Mar 22 '19 at 02:55 PM

avatar image

opgeturnt af
1 1

(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