Hi, I’m trying to modify the material of a decal component to change the color using
“Create Dynamic Material Instance” but it only works the first time. The second time I try to adjust the material, it just resets to the “default” one. I’ve been trying for a while to figure out if it’s a problem with my setup or a problem with the engine but I’m running out of ideas so that’s why I’m asking here.
Here’s a video of the effect in action. I have a cone that triggers overlap events whenever it finds a decal and then, grabs that decal’s material and changes its color. As seen, the first time it works, but the second time I try to do the same, the material just resets to the default one.
I can’t see what I’m doing wrong, also taking into account it works in normal materials (it can be seen in the video, on the material applied to the cube) and any help would be greatly appreciated. Thanks.
Hey! Thanks a lot for taking the time to reply so quickly!
It does work indeed. And after doing some tests the main difference is that in order for this to work, the dynamic material creation and modification need to happen inside the decal actor and I was triggering that modification from the colliding actor and getting the collided decal instead of from the collided decal itself directly.
Geez, I wish UE wasn’t so quirky, reminds me of JavaScript