Change opacity of flipbook

Hello everyone,

I am trying to create a flashing effect to my character flipbook when he is hit.
Is there a way to change Alpha real time for paperFlipbooks?

Thank you.

Anyone knows?

Hey -

Yes you can change the Opacity at runtime. You will need to create a new base material for the sprite(s) that you want to alter opacity for, you can duplicate the base material to have a good starting point. Before we open the new duplicated Material, Create a Material Parameter Collection in the Content Browser, for our purposes I will call it MPC_Roccinio. In the new MPC, create a New Scalar Parameter, for our purposes I will call it Opacity_Change. From that duplicated Material from earlier, take what is passed into the Opacity and First Pass it through a Multiply node. In the other input of the Multiply node add a Collection Parameter for your MPC_Roccinio that references the Scalar Parameter, Opacity_Change. Now in a Blueprint you can use a timeline to adjust the opacity by calling a Set Scalar Parameter Node which references your Parameter Collection and the Opacity_Change parameter.

A couple of warnings, You will need to be in 4.5.1 for MPC’s function correctly there was a bug with 4.5 that was corrected by the hotfix. Also any sprite that references the material which has the particular scalar parameter will be affected by the change. If you want to be able to do the same thing across multiple different material changes you will need to create a new MPC scalar value and a new material

Thank You

Eric Ketchum

Hey!
Thank you much for your answer but i am a bit lost.

This is a duplicate of the original “DefaultSpriteMaterial”.The idea if i understood correctly your answer, is to assign every sprite that i want to change its ALPHA with a different Default material from the property matrix that contains the MPC. So i created a new material that has as a “parent” material the duplicate original (DefaultSpriteMaterial).

Where do exactly i add my MPC since this material already has multipliers and the opacity is greyed out.Sorry about this but i just started learning about materials and i am a bit overwhelmed.

You will need to change the Material type from Masked to Translucent or you will not be able to get a smooth transition. The Masked Shader Model has a hard on or off Clip Value. You would then add an additional Multiply node and take the Alpha Multiply node and connect it to the new Multiple node with the MPC in the other input for the new Multiply node then take the new multiply node’s output and place it into the now exposed Opacity Material Attribute Node.

Eric Ketchum

Thank you for the detailed explanation. it works flawlessly but only for static sprites and not for flipbooks.Does this has to do with this?Set Translusent material to a Flipbook - Asset Creation - Epic Developer Community Forums

And if yes could you please help me out with the above question so i can finally see my flipbooks in all their glory? :slight_smile:

Hey -

Simply Change the Material when you setup the Sprite based on your flipbook.

Thank You

Eric Ketchum

1 Like

Could you please clarify something for me because it is driving me insane?
I had created 2 base materials for 2 of my characters . Lets call them"enemy 1" and “enemy 2” . Until today they worked perfectly and changed opacity per instance of each flipbook bp on my level(not all together). Today i tried to duplicate the whole process for even more enemies (using a 4.8 master branch release 3 weeks old)and now all the new created materials flash at the same time for all of the instances that reference them .The old ones do not.They work per bp.

Is this normal or it is a 4.8 bug? I do not understand why i see 2 different behaviours. Could you please help me out with this?

Thanks!
EDIT: It appears that i had forgotten what i did. The question now is how can i have multiple instances of the same enemy and change their opacity per instance.What happens for example if i have 200 enemy ships on screen and i want to flash only the ones that are getting hit by my lazers.The method that you have described above only works for one instance??

Hey is a sample project with the exact mechanic working via overlap event, you would just need to change it to a different event call.

Sample_Project

Thank you a lot! Your answer solved my problem.

Thank you for sharing!