I know how to normally do it, you go into the construction script, get a “Create Dynamic Material Instance” node, set the material you want an instance of, create a reference to that instance from said Node, and then you can access any parameters you have made within the material BP and adjust them accordingly.
This does not seem to be the way to do it for the child of a parent Blueprint however.
This does not seem to be the way to do
it for the child of a parent Blueprint
however.
Why not? What’s more, this is done automatically. By default the child will call the parent’s CS. And since the DMI variable is inherited, the script in the parent still applies.
Sorry for the late response, I was tired last night and I gave up after trying to get this working for 2 hours and made this post before going to bed so I got lazy and didn’t take screenshots, I honestly just expected someone to say “Ya sorry kid can’t do that”. I’m kind of new to the whole Parent Child BP family tree style programming but here is my problem:
The Parent is Called “Structure Master” and it has a empty static mesh called object that is inherited by the Child BP in question - Barrier.
Maybe I have some kind of misconception here? I just want to turn a light on and off in the “Barrier Bp”, and I dont see the “Light Intensity” parameter show up when I try to search for it.
The idea in my head was: build only code that all structures will use in the parent BP: I.E. like an automatic light system that turns the lights on in the structure when its night time.
And while I did indeed build the code to determine if its night or day inside the “Structure Master”, I dont know how to access or manipulate the particular light for its children within the structure parent itself, so I just thought I would create a boolean in the structure parent which is then used by the children to actually set their individual light intensities.
Omg I just realized I am a complete fool who should stop smoking so much ■■■■■■■■■
I have been trying, I swear to god, for 3 hours now to try and “Get Light Intensity” like its a normal variable, instead of “Set Scalar Parameter Value”, holy ■■■■.
Maybe I have some kind of
misconception here? I just want to
turn a light on and off in the
“Barrier Bp”, and I dont see the
“Light Intensity” parameter show up
when I try to search for it.
A misconception. To get a param from a material:
You set it in the same way - by punching in parameter name into the set / get node.
The idea in my head was: build only
code that all structures will use in
the parent BP: I.E. like an automatic
light system that turns the lights on
in the structure when its night time.
And that makes perfect sense, that’s what inheritance is for. If you create the dynamic material in the parent’s CS, all children will have it, there will be no need for each child to create one. Unless you want a child to have a completely different material of course, rather than an instance.