Engelard
(Engelard)
May 11, 2025, 8:00pm
1
Create Dynamic Material Instance works as expected but only when you select parent material manually, by hand:
Work
Don’t work
Completely the same M_Test_Inst
material but getting it from the existing mesh.
It is not allowed to make Dynamics from connected pins, or am I missing something?
L.F.A
(L.F.A.)
May 11, 2025, 8:35pm
2
Try to save it as variable before connecting it to the create node.
Engelard
(Engelard)
May 11, 2025, 8:58pm
3
I tried, that is not the issue.
L.F.A
(L.F.A.)
May 11, 2025, 9:04pm
4
This is unexpected. The example shown works at runtime. Please share more info to narrow down your issue.
nande
(nande)
May 11, 2025, 9:15pm
5
are you sure the element index is correct?
i’ve used that code multiple times.
L.F.A
(L.F.A.)
May 11, 2025, 9:16pm
6
Yes, me too. In this tested case the character mesh has a single slot. Are you having issues with multiple slots?
nande
(nande)
May 11, 2025, 9:17pm
7
also some components (i think maybe primitivecomponent) have a function called the same or similar (like CreateDynamicMaterialInstance) which will try to create a DMI for the current assigned material. so it’s the same, but more efficient since it makes sure it does not create it twice.
so you can simply do Mesh->CreateDynamicMaterialInstance()
Engelard
(Engelard)
May 11, 2025, 9:26pm
8
Indexes are correct and not the issue. Created Dynamic Material is dead right after creation:
Inputed Parent material is alright however.
L.F.A
(L.F.A.)
May 11, 2025, 9:36pm
9
What is the input of the create node? Get Material from a primitive component?
Have you seen this?
Engelard
(Engelard)
May 11, 2025, 9:37pm
10
OMG OMG OMG!
There is actually the second function, completely identical name with different inputs, which unlike the other one - works:
Several hours just went to this…
L.F.A
(L.F.A.)
May 11, 2025, 9:40pm
11
Great, this is Unreal. Also, check the creation flag as transient and see if returns invalid.
Good luck.
1 Like