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"

Dynamic Material for WidgetComponent.


I'm trying to change the material of a widget component in blueprint. I have try to "Create Dynamic Material Instance" but it's look like it isn't working for WidgetComponent. I have correct result if i'm using the interface or if i apply the result on a staticmeshcomponent. If someone have a solution for my problem, i listening ;-)

PS : I need a DynamicMaterialInstance to be able to change a parameter.

alt text

I'm trying this :

alt text

and the result is this :

alt text

Instead of this :

alt text

Product Version: UE 4.19
capture.png (11.9 kB)
capture2.png (52.0 kB)
capture3.png (69.6 kB)
capture4.png (73.7 kB)
more ▼

asked Aug 22 '18 at 02:05 PM in Blueprint Scripting

avatar image

1 1 2

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

1 answer: sort voted first

It's a bit of a strange approach.

Normally, you would make a dynamic material and apply it to a 2d widget and then display it in a 3d widget.

Is there a reason why you cannot use this method?

more ▼

answered Aug 22 '18 at 02:10 PM

avatar image

15.3k 77 26 64

avatar image alibatiste Aug 22 '18 at 02:18 PM

I'm from Unity and I'm only using Unreal for 2 weeks so i'm open to every solution. My Material is playing with vertex, can i do it if a applying my material to a 2D widget? Btw: what's the difference between a 2d widget and a 3 d widget?

avatar image Everynone Aug 22 '18 at 02:24 PM

No. Definitely no. 2d widget material is exceptionally simplistic.

In this case, find the material the 3d widget is using, make a copy, move it to your project, open that copy and add the code you have in your own material on top everything else it is doing.

This way you'll preserve the pass through material (there's like 5-6 different versions there - I think they're actually dynamic instances, too) and can add your own fancy stuff to it.

Untested, never seen anyone trying to do it. Let us know how (if) it works out!

avatar image alibatiste Aug 22 '18 at 02:48 PM

I think it's already what i have.

I have a WidgetBluePrint (with regular shader)

I have a WidgetComponent in my Actor.

I have a custom material witch is a copy of default shader and when apply in the field, it's working.

My problem happen what i try to set the material of the widget by script.

avatar image Everynone Aug 22 '18 at 03:33 PM

So MI_ScoreMaterial is based on the pass through material?

avatar image alibatiste Aug 22 '18 at 03:39 PM

yes it's a copy of Wideget3DPassThrough

avatar image Everynone Aug 22 '18 at 04:03 PM

Tried it myself and I'm getting the same result as you. I'll fiddle with it out of sheer curiosity and report back if I find out why it doesn't work.

Is there any particular functionality you're expecting from the setup? I assume you've chosen a 3d widget because of a certain interaction type?

avatar image alibatiste Aug 23 '18 at 08:01 AM

I have 2 effect in my material: 1) A billboard effect (always looking at the camera) (doesn't need dynamic effect) 2) A pixel like disappear. (which need the dynamic effect).

I will try to make 2 materials. One on the 3D object or the billboard and an other for the 2D object. I this the solution i want but it's a solution.

avatar image alibatiste Aug 23 '18 at 08:53 AM

This solution is working... the bug is still there but i get around it ;-) Thanks for your help.

avatar image Everynone Aug 23 '18 at 08:55 AM

Glad to hear you found a satisfactory workaround.

Still not sure why widget component is happy to use a material instance but the dynamic material is a no-no. :|

avatar image Efrye Jul 13 '19 at 09:07 PM

I'm experiencing the same issue and don't quite understand the solution mentioned above. Is there any way to use dynamic materials on widget text?

(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