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
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. 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!
asked Aug 15 '17 at 03:59 AM in Blueprint Scripting
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.
answered Aug 16 '17 at 03:12 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here