Hello!
I can not add a material from c ++
my code…
**
the static mesh if it is loaded but the material does not
**
**
result:
**
**
the material does not load, what am I doing wrong
**
Hello!
I can not add a material from c ++
my code…
**
**
**
**
**
**
It’s not a Material Instance, it’s a Material. So try changing UMaterialInstance
to UMaterial
.
@erikdubbelboer ok friend…
now if you add it in the editor, but when compiling the materials are not reflected
try creating an instance of the material like this:
and changing my code like this:
it does not work, materials are not reflected
Now I realized that if I change the component from “UInstancedStaticMeshComponent” to “UStaticMeshComponent” if it works, but I need them to be instances. “UInstancedStaticMeshComponent”
Materials have an attribute “Used With InstancedStaticMeshes”
You have to toggle that to true in the editor and then it should work.
@erikdubbelboer thank you very much, that was all