0 Favourites

How do I make behaviors repeat?

  • 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.

  • The LiteTween plugin will let you do this:

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[BEHAVIOR] Chipmunk Physics
673 82,471
nelostic's avatar
Unread hot topic
0 Favourites
[Behavior] LiteTween
672 169,834
manujorgo's avatar
Unread hot topic
564 105,179
rexrainbow's avatar