Sine behavior question

0 favourites
  • 9 posts
  • Hey everyone,

    Is there a way to allow a sine behavior with SIZE movement to oscillate the object's size between, say, 20% to 60%?

    In other terms, if I apply the behavior on an object of 100x100 pixels with magnitude to 40, I will always get a sine movement between 80 and 120% of the objects' standard size. I would like to make its size vary from 20 to 60 pixels without changing the size of my base object (which should remain 100x100 pixels).


    Thanks for your help !

  • Not fully understanding your issue, but try using an invisible helper object with the sine behavior/motion size you want, and pin the full size object to it.

  • I am not sure how you can change the size without changing the size. I do believe we need a more clear example of your intended goal.

  • It sounds like you are describing the bulge effect?

    Look at that effect and you can set radius and use an event like every so many seconds to change the effect.

    You can change size directly of any object but if you want it changed over time then you need to use a timer and every so many seconds or every tick.

  • It would be nice if you could modify the Sprite.Sine.Value, but the behavior doesn;'t allow for that.

    you'd have to do it manually... I'm sure the math is here on the forums somewhere...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can imagine a double sine behavior.

    Create a decoy sprite with sine behavior: NUMBER ONLY

    Give you main object the SIZE SINE behavior and set magnitude to DECOY.Number

    There you go!

  • Thanks everyone for your answers, and sorry if I've been unclear.

    Here are some additional explanation about what I'm trying to achieve:

    I have an object whose size is 100x100 pixels.

    If I add a sine/size behavior with 20 magnitude, it's size will oscillate between 80 and 120 pixels (if I'm correct)

    I want it to oscillate between 20 and 60 pixels.

    Is there a way to achieve this using the sine behavior?


    I've been able to make it work with your solution! It's a bit complex to set up, though... ^^'

    I think it's possible to give both sine behavior to the same object or use math to set size of object every tick to the value of the (value) sine behavior, so we use only one sine.

  • Sine20_60.capx

  • korbaach

    Thank you for the elegant demonstration.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)