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"

Help with Blueprint - Changing material on static mesh by clicking, then having it change back by clicking it again.


I am working on a blueprint when you click the light switch, the material on the static mesh swaps out for an identical material but it has emissive on it using Set Material. That works fine. What I have been unable to figure out is how do I get the material to go back to the original material when I click on the light switch again.

I did a search and coudln't find any info regarding something like this.

Any help would be greatly appreciated. alt text

Product Version: Not Selected
bluelight.jpg (50.5 kB)
more ▼

asked Jan 08 '15 at 08:17 PM in Blueprint Scripting

avatar image

12 3 3 5

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

1 answer: sort voted first

You can use a flip/flop logic to do that. Ie for each click alternate beween action A and action B.

A reliable method would be to add a boolean varible inside your blueprint called 'LightOn'. Then in your OnClicked Event handler (the one in the picture), you will first check if the value of LightOn is true or false (using Branch). If its false, then you will change the value of LightOn to true and then change the material to once with the emissive. On the other hand if the value of LightOn is true, then you will set it to false and change the material back to original.

more ▼

answered Jan 09 '15 at 02:57 AM

avatar image

3.4k 154 52 271

avatar image terrygmorse Jan 10 '15 at 06:24 AM

Unfortunately I was never able to get the boolean method working no matter what configure I put the nodes in. The flip/flop logic worked however. Thank you. Would love to get the boolean working as it would work with so many other things I have planned for my scene. Any way you could post a blueprint?

avatar image ederoliveira20 May 22 '15 at 06:39 PM

But how come when you want to use 3 or more materials? Please Answer

(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