There are a lot of resources online on how to create dynamic materials and adjust them but I have been unable to find a way to be able to adjust a dynamic material’s parameter through code. For ex. I have my guy with an exoskeleton. When I press a key, he plays a sound and animation of the exoskeleton turning on, and there are lights on the exoskeleton that glow bright through the emissive property. I can create my dynamic material instance and assign it through the construction script of the character all dandy n fine (shown in attached.)
What I want to do is automate this process of the emissive going from 0 to 100 in realtime during gameplay and updating the the dynamic material, quite possibly, triggered by a keystroke, sound cue or animation notify. Either of them would do.
I have been unable to find a way on the internet to do this. Help appreciated pls
Thank you so much! The timeline thing worked! I kept the material creation in the construction script and only used the timeline to change the scalar parameter value in the event graph.
While I’m completely satisfied with this running through the characterBP, is it possible to have this work through the animBP? For the sake of keeping my code in one place, I only used the characterBP to toggle a variable and called that variable in the animBP to check if it’s ON, and did the rest of the work in the animBP, playing the sound and animation.
So I really wanted a way to be able to set this scalar parameter through the animBP so I could put it all in a single comment box and be done with it.
No worries
I know basically nothing about anim BPs I’m afraid. Even so, it doesn’t seem a logical place to have it.
Either way, thank you so much! I was stuck on this for 2 days! <3