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"

Blueprint for toggle material not working


Need some help. Based on some tutorials and other info's I've constructed a blueprint that suppose to change (toggle) materials with one key on a static mesh while in Game play. Guess I am doing something wrong because I did everything the tutorial said but still not working. Here are some insides of the blueprint:

alt text alt text

I've made the material with two elements (elemnt 0, element1) so I can make the change. As I understood in the "Set material" function I should put the element index=element 0. and into "Material" should put the material that the static mesh would change into. Something like this:

alt text

But still it's not working. I don't know where is the problem. Btw my construction script is empty. Maybe I should specify some stuff there?? Guidelines are needed here ;)


Product Version: UE 4.18
more ▼

asked Oct 31 '17 at 05:32 PM in Blueprint Scripting

avatar image

16 5 8 14

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

I fixed it. The problem was in the material. In the Content Browser, open the material and in the Details, under "Usage" I checked the box "Used with skeletal mesh". I tried this with different materials, and the blueprint for toggle material works only with the materials that have this box checked.

more ▼

answered Nov 02 '17 at 07:03 PM

avatar image

16 5 8 14

(comments are locked)
10|2000 characters needed characters left

Put a PrintText node after the F in order to check whether the key fires at all; if it's not printing anything, you need to enable Auto Receive Input in Class Settings (top toolbar) for this blueprint.

more ▼

answered Oct 31 '17 at 07:28 PM

avatar image

12.6k 72 24 52

avatar image anetopuceto Nov 01 '17 at 10:28 AM

I did what you said, I put a PrintText node after the F and it printed text in the output log window, so I guess this means the key works, but still the material doesn't change. What should I do next?

avatar image Everynone Nov 01 '17 at 12:59 PM

So you're getting nothing at all when it comes to the material change, hm. As a test, could you create the most basic default material and try to assign it the mesh with the F key without the multigate (although this should not matter).

How many of these objects are there in the level? More than one?

Also, when you open the mesh from the ContentBrowser, do you see the slots?

alt text

capture.png (84.9 kB)
avatar image anetopuceto Nov 01 '17 at 01:26 PM

I only have one object in the level that I want to change material, and when I open the mesh the slots look like this:

alt text

and when I press the F key while I'm in the box collision on the mesh, the event graph looks like this:

alt text

And still doesn't change anything!

materialslots.jpg (268.9 kB)
keyf.jpg (428.4 kB)
(comments are locked)
10|2000 characters needed characters left
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