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. 

Structs and widgets

Well hello again! :D Here is my question: i have actually a struct for manage several variables buildings or actors; in each building i have the same widget showing the diferent names and numbers (comming from the variables inside the struct) but when i try to change the integer inside of each building or actor it changes globally at all the buildings who shares the same widget / struct. Am stuck at this point. Please help me.. am a good human being :D :D :D Regards

Product Version: UE 4.15
more ▼

asked Jul 19 '17 at 07:18 PM in Blueprint Scripting

avatar image

20 4 4 6

avatar image BenVlodgi Jul 19 '17 at 07:40 PM

Could you post the code that shows how you get the struct from the bp for the widget?

avatar image Tapsino Jul 19 '17 at 07:58 PM

Sure! and thank you Ben for your early answer! This is my scene:

alt text

And this is how looks inside those actors

alt text

Then this is the functions that refresh the widget counter

alt text

and this is the text inside the widget

alt text

So.. my widget is incrementing the integer inside the variable... but is doing for all actors... and showing the increment just in one single actor

maybe is a silly mistake but am really stuck right now Thank you again! regards [1]: /storage/temp/202705-01.png [2]: /storage/temp/202706-02.png [3]: /storage/temp/202707-03.png [4]: /storage/temp/202708-04.png

01.png (598.8 kB)
02.png (209.4 kB)
03.png (178.0 kB)
04.png (78.4 kB)
avatar image BenVlodgi Jul 19 '17 at 08:10 PM

No problem, happy to help. Answer below.

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

1 answer: sort voted first

You're only updating the struct for the first widget that exists in the list of all Counter objects. With your Get(0), you're only getting the first widget.

You should create a reference in the building to the Counter, so you can reference it directly.

Or you should use a generic object with properties instead of a struct. That way when you update the info container, it will update everywhere. Including your widget which will have a reference to that same info variable.

ue_answerpic22a.png (206.3 kB)
more ▼

answered Jul 19 '17 at 08:15 PM

avatar image

2.1k 38 17 52

avatar image Tapsino Jul 19 '17 at 08:45 PM

ohhh i see... as i said.. a silly mistake. But i tried using a generic object, i guess am too newbie. It's not distributing correctly. Can i send you the proyect? is a very (very) small proyect. that would be great Ben. (sorry!) https://www.dropbox.com/s/jyu6d5vyg6fn24g/test.rar?dl=0

avatar image Tapsino Jul 20 '17 at 02:00 PM

I have tried referencing directly too and nothing :(

avatar image Tapsino Jul 20 '17 at 02:11 PM

It worked! thank you very much Ben!!!!!!!

avatar image BenVlodgi Jul 20 '17 at 03:31 PM

Glad 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