Static switch parameter in actor blueprints?

Hi im trying to setup a master sprite material for an enemy that would allow different body parts to be blown off. I am trying to do this using a static switch parameter in the material that swaps from a undamaged material to a damaged material. I have tested this using a material instance to see it working however I have no clue on how to call this inside the character blueprint itself. Any help would be appreciated thanks :slight_smile:

You just need to assign a dynamic material instance to the mesh during startup. Just drag the mesh into the BP map and drag a pin from that and type ‘dynamic’. You’ll see the dynamic material instance.

Initially it should have settings for ‘not blown off’, but when the damage happens you can just change the instance parameters from BP using SetScalarValue ( or Set… something else by dragging off from the variable you assigned to the instance at startup ).

Unfortunatly I’ve found out that its impossible to change the static switch parameter from within blueprints xD. I have come up with a work around though instead. Using a Enum for the sprite states (i.e non damaged, head blown off ect) then setting up an array with the relative sprites as textures then swapping them out on the dynamic material instance of the sprite when a bool is true. Its kinda a pain in the butt as i have a total of 15 variations per character state. I’ll probably come up with a better way to do this eventually but right now it works. blasting arms n heads everywhere :wink: