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!
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.
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!
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
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.