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"

Cannot modify materials for spawned actors?

I'm having trouble changing an actor's material parameters once spawning them. Here's the code so you can understand the process.

I spawn the tire objects and add the actors to an array alt text

Next I loop through these tires, and for each tire I go through an array of element numbers that need to be modified. For each of these element numbers, I get the material it refers to and create a DMI from it. alt text Here is where it gets annoying. The spawned tire does not have ANY materials attached to it! I found this out by using the Get Num Materials node, and that just returns 0!

I'm completely lost as to why this is happening, and any help will be appreciated!

Product Version: UE 4.15
Tags:
1.png (105.1 kB)
2.png (195.9 kB)
more ▼

asked Aug 15 '17 at 03:59 AM in Blueprint Scripting

avatar image

GodzillaFiresox
17 3 4 9

avatar image GodzillaFiresox Aug 15 '17 at 04:43 PM

Update on this. I finally got it to actually recognize all the materials that are in the skeletal mesh! So now when I use the Get Num Materials node, it returns the correct amount. However, I still can't change the spawn actor's vector parameters. alt text I've tried using both Get material and Get base material but both don't work. Hope someone else who has more knowledge in this are can help me out!

3.png (215.8 kB)
avatar image GodzillaFiresox Aug 15 '17 at 04:58 PM

oops there's supposed to be a connection between create DMI return value and Set vector parameter value target node. Still doesn't change anything in game

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

1 answer: sort voted first

This is a bit hard to follow where everything is coming from so instead i will just post how i would do this, let me know if i misunderstand. One note is that the way you are using CreateDynamicMaterialInstance does not need a source material unless you want to change the material parent, otherwise it uses the current material as the parent for the new one.

alt text

capture.png (198.3 kB)
more ▼

answered Aug 16 '17 at 03:12 AM

avatar image

RimmyD
2.5k 97 14 96

(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