I’ve tried using set material on the instanced static mesh component in blueprint. I’ve tried choosing the material for the instanced static mesh in the components list. Whatever I try, the mesh is always shown with the default material. maybe there’s only a specific type of material that works with instances, or maybe you have to use a specific setting somewhere to make it use the material? I’ve been looking over the forums and can’t find any example of doing this. Can someone show me an example of how make an instanced static mesh use a material? or a link to an example?
I don’t think he uses instanced static meshes in that.
Hello,
Except if something has changed recently : sadly, you can’t, i did some tries too and could change of them only : How do I set per-instance material parameters on instanced static meshes? - Rendering - Epic Developer Community Forums
Only an idea on the fly i would try in your situation to have benefit of instances, not sure it would work : Create two bp with ISM with both materials, when needed, get location, destroy the first, add instance to the other in location. (maybe with an array to register location)
I believe the only thing that can change between instances is transform since they are part of the same component. When you add an instance to an ISMC you’re expanding the original ISMC. When you add a new StaticMeshComponent, it’s a whole new component.
I was trying to figure out how to get them to show up at . in the first place. The answer is, you have to check “Used with Instanced Static Meshes” in the material properties. This was something simple I couldn’t find anywhere. I actually had the advanced parts figured out but I was unaware of that one little setting. Lame. For anyone else trying to figure out how to use them, watch this video https://www.youtube.com/watch?v=mI7eYXMJ5eI
We misunderstood your question, sorry. I thought you tried to change the material of one instance, during runtime.
Hey I have similar problem the material is not applied on instanced static meshes and I don’t know why what I did is:
opened a new c++ project just basic code,
I’ve created:
c++ Actor class “Tile”, declared UStaticMesh in it, I’ve created A blueprint from this class and set the static mesh and material, the material is created by me and it has the “Used with Instanced Static Meshes” flag set
c++ Actor class “MyLevel”, declared UInstancedStaticMeshComponent, and a TSubclassOf<ATile> in it, the “TSubclassOf<ATile>” member is UPROPERTY that can be edited anywhere and it is set to Tile Blueprint that I’ve created.
In "MyLevel"constructor I create instancedStaticMeshComponent, in BeginPlay() I check if TSubclassOf<ATile> is set and if I set the InstancedStaticMesh->SetStaticMesh() and just to test I also add instance of that mesh, and now the mesh is rendered but with default material and I have no idea why. Can any one help solving this problem ?
code from MyLevel class
.h file
.cpp file
Code from Tile class
.h file
.cpp file
Material
tile blueprint
MyLevel Setting in editor
the final result
on left instanced static mesh on right Tile_BP dragged and dropped in editor
Any idea why this is happening ?
I had the exact same problem, and this was the answer for me:
->“set “Use with Instanced static Meshes” in the material setup”
Thank you!
There wasn’t even a warning in the Output log about this. Pretty bad UX.