I’m trying to create some boxes from within a blueprint.
When you use the brush to create a box, it is with a material and such.
However, when I create a box with “AddBoxComponent” from my blueprint, it makes a box alright, it is just not visible. I see the outline of it fine, so it is there. But the material I set it to use is not used. So in effect, there is no box.
Heya ,
You can accomplish this by using a Dynamic Material Instance and a Scalar Parameter in your box’s material. A blueprint to generate your static mesh, assign the Dynamic Material Instance, and set the parameter in your material to the average scale of the Actor:
Note the name of the Scalar Parameter (UnifiedScale) matches what’s in the Blueprint’s Set Scalar Parameter Value (Parameter Name pin), and you should it’ll end up working pretty well:
There are plenty of ways to make this better, as depending on UV’s things can end up looking wrong, and if you scale along just one axis the material will scale uniformly.