How do I make behaviors repeat?

Get help using Construct 2

Post » Tue Jun 14, 2016 4:25 pm

I need a sprite that has a fade behavior to either loop or repeat after a time. I have a duplicate sprite on top of the original. The duplicate is modified to have a glow and saturated colors. I have a fade behavior applied to the topmost sprite that I am causing to fade in and out, but I am only able to do this once. I am trying to get it to repeat so it looks like it's pulsing softly.
B
40
S
18
G
5
Posts: 98
Reputation: 5,651

Post » Tue Jun 14, 2016 4:52 pm

The LiteTween plugin will let you do this: behavior-litetween_t70700?&hilit=litetween
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,847

Post » Tue Jun 14, 2016 4:54 pm

With the fade behavior, make sure that you have set the property "Destroy after fadeout" to no, otherwise you can't make a "cycle" because simply your object/instance does not exists anymore.
You will also need to have two fades behaviors on the same object for it to work, one fade in, another fadeout. Make sure for both that they don't attempt to destroy the object when they are done. Make sure to change their names to something obvious as well (you can modify the name in the behavior dialog).
I'd use something like FadeIn and FadeOut.

On FadeOut fade out complete - FadeIn - Fade restart
On FadeIn fade in complete - FadeOut - Fade restart

That should help getting your cycle.

But perhaps you should rather look into using the Sine behavior, using the property "opacity" rather to obtain that pulse effect. It sounds simpler and will achieve the same look in the end.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,287

Post » Tue Jun 14, 2016 6:59 pm

The Sine behavior worked perfectly! It gives me a lot more flexibility in control too.

I would have never discovered this on my own. My only criticism would be that it shouldn't be categorized as a movement, but rather under general behaviors. And even then changing the "movement" property label to something more general like "mode"

I am also going to check out LiteTween.
B
40
S
18
G
5
Posts: 98
Reputation: 5,651


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests