The problem is that it works only with sprite that normally have uniform opacity, if I have some sprite with full opaque parts (opacity=1) and translucent (opacity=0.3/4) parts the last one are instantly brought to a opacity value of 1 and have a terrible appearance…
How can I let a sprite slowly fade on triggerbox overlap without changing opacity or at least without increasing transparent parts’ opacity??
I would like to clarify what you are attempting to do so I can run some tests on my end. You have a sprite that has different opacity levels on it, and you would like to only fade out parts of the sprite along a timeline?
I have a sprite with different opacity, yes, and i would like to make it fade completely. My fade value (in the fading timeline) vary from 1 to 0… bringing every part of the sprite to opacity one.
Would you mind providing me with the sprite asset you are using so I can test exactly the same set up you are using? A screenshot of the sprite and how you have it fading out would be helpful as well.
In what way are you applying this approach in your game or what is the purpose of this feature?
I ask so I can perhaps find a better or different way to approach this issue as far as practical usage and functionality within your project.
With full opaque sprites (with shrink wrapped rendering) this method works perfectly but if i cannot use the shrink wrapped rendering or if the sprite has some transparency it doesnt work.
I set a scalar parameter of 1 in material’s opacity and then, in the blueprint, i use “set scalar parameter value” to slowly bring it to 0 using a timeline.
My purpose is to let a sprite slowly disappear whenever a character enter a triggerbox and let it slowly appear when the character get out of it. So i created a blueprint with the sprite and the triggerbox and i give it the custom material that has a scalar parameter linked to the opacity node.
I managed to get a working prototype of what you are attempting to do and my steps and content are listed below. I set up my approach a bit differently as far as calling on the timeline, but I will do my best to point out the differences as well as make it clear on the important parts to take note.
Here you can see I created a simple ‘Actor Blueprint’ with a PaperSprite component and a Box collision. Take note of the component variables as well. I only had to create one variable since it will be referencing itself there is no need for a target variable.
Here I have set the material properties of the Dynamic Material created within the blueprint. Still using the DefaultLitSpriteMaterial as its parent class.
I started at the value of 1.0 since that is the ‘Opacity’ the sprite will fade out from, and gradually fade to 0.0 along a linear curve over 5.0 seconds.
Finally we test to see the sprite fade upon overlapping the collision box. If you are still having trouble please let me know, but hopefully this gets you on the right path!
If you are experiencing a different issue we ask that you please make a new answerhub post. This is done for others who might be experiencing the same problem so they can find the correct solution to their issue.