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. 

Override Widget properties via Blueprints

Hello,

I'm having a bit of troubles trying to override the properties of a Widget that is component of another Blueprint.

The use case I'm referring to is the following:

  1. Create a Blueprint ("MyBlueprint")

  2. Add a Widget as Component ("MyComponent")

  3. Create a Widget ("MyWidget") with just a Canvas and an Editable Text

  4. Set "MyWidget" as class of "MyComponent"

  5. In the Construction Script of "MyBlueprint", override the text of the widget as follows: alt text

After Blueprint compilation, something weird happens: the Blueprint editor shows the correct text (the one set in the variable), while in the scene the text is still the default (set in the UMG editor).

If I move the actor around triggering the Construction Script, the text becomes correct in the scene too. But, if I recompile or change any default value of the Blueprint (not just the text variable), the text reverts back to the Widget default.

I checked that the Construction Script is actually called even when the displayed text has been reverted to default, but it's like the text override gets ignored/discarded. I've got the idea that the Construction Script manipulates a Widget instance that later gets replaced by a new one (are Widget mutable at all?), but I might be wrong.

Can someone please tell me what am I doing wrong? Thank you.

Product Version: UE 4.14
Tags:
constr.png (111.4 kB)
more ▼

asked Feb 20 '17 at 12:08 PM in Blueprint Scripting

avatar image

Jacopo Papaccio
31 1 7

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

3 answers: sort voted first

Hello Jacopo,

I was able to reproduce your issue and have logged a bug report for it here:

https://issues.unrealengine.com/issue/UE-42137

You can track the report's status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

more ▼

answered Feb 20 '17 at 02:56 PM

avatar image

Thomas G ♦♦ STAFF
7k 64 4 54

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

Guessing this is still outstanding...as I just wrote the same code and still doesnt update...??

more ▼

answered May 30 '17 at 07:47 AM

avatar image

DunkenKBliths
206 3 100 15

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

OK...frustration aside I think I have managed to make something work...

Instead of using Construction...just do it on the Event Begin Play...this forces it to run on the first time

Seems to work !!!

more ▼

answered May 30 '17 at 07:55 AM

avatar image

DunkenKBliths
206 3 100 15

avatar image Jacopo Papaccio May 30 '17 at 08:42 AM

Yes, but that way you can't run the code at editor time - which was what we were trying to achieve. I actually didn't manage to solve this issue anyway: just had to get around it for time constraints.

(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