Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ExprSt on November 21, 2013, 02:17:30 PM

Title: Object Appear Slowly
Post by: ExprSt on November 21, 2013, 02:17:30 PM
Hi,

I wish to creat a scene where appears the following:

1) Player click with the mouse on a Buttom;
2) An object appears - but, and here is where I'm stucked, I wish that the object which is created is spawn slowly, from 0% visibility to 100%;
3) I also wish this object that is spawn to move while it's becoming more visible to the player.


May anyone help?

Regards.
Title: Re: Object Appear Slowly
Post by: Lane on November 21, 2013, 02:39:16 PM
Create the object and change the alpha on the material its using from 0 - 255 over time.
Title: Re: Object Appear Slowly
Post by: ExprSt on November 27, 2013, 03:20:10 PM
Great!

But how do I change de alpha?
Title: Re: Object Appear Slowly
Post by: jeanfabre on November 28, 2013, 02:17:28 AM
Hi,

 you need to have a material with a transparency setting ( the default diffuse doesn't) and then you can animate that alpha property using "set Material Color" or "set Material float" action.

 Bye,

 Jean
Title: Re: Object Appear Slowly
Post by: ExprSt on November 28, 2013, 09:10:38 PM
I tried it but I don't see where to put the "Time" variable.

May you help longer?
Title: Re: Object Appear Slowly
Post by: Breadman on November 30, 2013, 01:53:55 AM
I faced this same challenge. I wasn't able to locate a "change over X amount of time" variable, so here's my workaround (not the best, but it works)

Let's say you're starting at 0% opacity and want to end at 100% opacity. Let's say your material is "concrete".

I would take the material and duplicate it 10 times, and name each one "concrete0", "concrete10", "concrete20" etc all the way up to "concrete100". Each material has the same color/texture, but has its opacity set to the proper value (concrete10 has 10% opacity, etc).

My FSM would use the "set material color" action, set it to concrete 0 on start, wait X amount of time (using the wait action), and then go to a new state, where it assigns "concrete10", waits the same amount of time again, and then sets it to "concrete20", etc.

You can change the speed and smoothness of the opacity transition by adding more materials with smaller changes in opacity, and changing the "wait" time between each state.

Again, I'm sure there's a better way, but this was my clumsy method :D
Title: Re: Object Appear Slowly
Post by: jeanfabre on December 02, 2013, 02:05:48 AM
Hi,

 Ok, study the sample I attached to this post, it fades a material as you click on the object and back when you release.


 bye,

 Jean
Title: Re: Object Appear Slowly
Post by: ExprSt on December 03, 2013, 12:33:21 PM
Outstanding!!!!

Thanks!