Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
more ▼

asked Oct 12 '14 at 05:21 PM in Blueprint Scripting

avatar image

576 52 56 77

avatar image Roccinio Oct 15 '14 at 10:38 PM

Anyone knows?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Roccinio -

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

more ▼

answered Oct 24 '14 at 06:06 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.7k 702 260 735

avatar image Roccinio Oct 25 '14 at 12:27 PM

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

alt text

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.

avatar image Lovecraft_K ♦♦ STAFF Oct 28 '14 at 03:38 PM

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

avatar image Roccinio Oct 28 '14 at 07:25 PM

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?https://answers.unrealengine.com/questions/124061/set-translusent-material-to-a-flipbook.html

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

avatar image Lovecraft_K ♦♦ STAFF Oct 28 '14 at 07:39 PM

Hey Roccinio -

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

alt text

Thank You

Eric Ketchum

translucent.jpg (125.9 kB)
avatar image Roccinio Feb 02 '15 at 10:48 PM

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??

avatar image Lovecraft_K ♦♦ STAFF Feb 03 '15 at 06:41 PM

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.


avatar image kevinvik Jan 01 '19 at 12:34 AM

Thank you a lot! Your answer solved my problem.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question