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"

HUD and Material Instance

Hello everyone.

I'm having a problem trying to use HUD and material instance. Here's the explanation:

I have a mesh at my level which has a material instance of a material. This material has the emissive color as a parameter so I can change it at the instance. My HUD creates a widget that contains a few buttons. What I want to do is click on one of these buttons and change the emissive color parameter to zero. Here is the code for the creation of the widget inside the HUD:

alt text

In another part of the code I used this to change the material of a mesh: alt text

How can I access the material parameter from inside the widget code?

Thanks for the help!

Product Version: UE 4.16
Tags:
hud.png (108.9 kB)
widget.png (96.9 kB)
more ▼

asked Jun 12 '17 at 06:10 AM in Blueprint Scripting

avatar image

SergioAAV
10 1 3 5

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

2 answers: sort voted first

Hi,

Take a look at my approach;

Sample material graph alt text

I've created the material instance inside the construction script for this example. alt text

Inside widget event graph alt text

I've tried this approach and worked. One thing to note is that it affects all the blueprints of the same class in your level.

Regards,

material.png (200.8 kB)
more ▼

answered Jun 12 '17 at 12:24 PM

avatar image

navid100
1k 29 14 46

avatar image SergioAAV Jun 15 '17 at 03:33 AM

Thanks for the help. It worked perfectly for what I needed. Only one observation, you don't need to use the Cast To block.

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

Hello SergioAAV,

Can you use "Set Vector Parameter" node. For this https://answers.unrealengine.com/questions/657471/get-color-of-texture-sample.html

more ▼

answered Jun 12 '17 at 07:20 AM

avatar image

Sertac Ogan
1.5k 30 11 46

avatar image SergioAAV Jun 15 '17 at 03:34 AM

Hey man, thanks for the help but the method below from navid100 worked better for my situation.

(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