Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ilovelessons on June 02, 2017, 11:06:56 PM

Title: Getting an animation the slowly fade away?
Post by: ilovelessons on June 02, 2017, 11:06:56 PM
Hi,

I made an animation of a diamond for a game (its a reward for when you accomplish something).  I managed to make it rise slowly by adding a rigid body to it and changing the gravity to -5.  However as it rises it need to slowing fade out of existence (i.e. I need to the alpha to slowly be reduced to zero). Anyone knows what function/action I need to use in Playmaker?

Thanks
Title: Re: Getting an animation the slowly fade away?
Post by: Doh on June 05, 2017, 07:14:03 AM
You could use "ease float" to animate a variable for use as your alpha value.

Create 3 floats:

a) representing your maximum alpha value
b) representing your minimum alpha value
c) representing your current alpha value (the one to be animated)

"a" would be the "From Value", "b" would be the "To Value" and "c" would be the "Float Variable". The "Ease Float" action allows you to tweak a few parameters of the animation too.

So to then use this animated float as your alpha channel value, apply a "Set Color RGBA" action to the same state.

This is one of a number of methods you could use.