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"

Transfering Integer to widgets?

Hey guys, Iam kind of lost and out of ideas how to set the text of a text block (Widget) to the same value as my Integer. Ive tried to set up a "Cast to" but with that i don't know what to select as an object. This is the last step to finish my game please help guys!

alt text

alt text

Product Version: UE 4.16
Tags:
q^1.png (164.8 kB)
q2.png (148.2 kB)
more ▼

asked Jun 18 '17 at 02:29 PM in Blueprint Scripting

Brohst gravatar image

Brohst
3 2 3

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

You have two approaches to this:

  1. Make an event that sets the text as you want it that is being called from outside the widget and pass the int as a parameter.

  2. Make a variable inside the widget of type integer OR whatever actor that has the int. Give the widget a copy of the int or a reference to the actor which has the int you need and simply access the int or actor reference when you need to set the text.

HTH

more ▼

answered Jun 18 '17 at 02:49 PM

NoobsDeSroobs gravatar image

NoobsDeSroobs
2.4k 97 18 146

Brohst gravatar image Brohst Jun 18 '17 at 04:10 PM

My problem is to get the reference set up correctly. Would you be so nice and send me a few screenshorts?

Brohst gravatar image Brohst 6 days ago

Or at least tell me how to set up the reference?

MatzeOGH gravatar image MatzeOGH 6 days ago

You can pass the reference of the actor to the widget via a function or set it manually. For that to work, you only have to add a variable,of your actors type, to the widget.

(comments are locked)
10|2000 characters needed characters left

Hi,

This is how you can do it;

Store your integer inside a cast-able blueprint.

Go to your HUD or any other blueprint and create your widget there.

alt text

Go to your widget, add a text block and select it. Under the content tab, bind it to a function. Follow my graph.

Cast to the BP you have stored the integer there (which is player character BP in my sample). alt text

You are done.

Regards,

hud.png (156.4 kB)
widget function.png (189.1 kB)
more ▼

answered Jun 19 '17 at 01:50 PM

navid100 gravatar image

navid100
591 22 4 32

(comments are locked)
10|2000 characters needed characters left
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