Sine behavior

0 favourites
  • 10 posts
  • Sine behavior is missing some actions to allow setting the following:

    Period Random

    Period Offset

    Period Offset Random

    Magnitude Random

    To reproduce:

    Add sprite, add sine behavior.

    Add every tick event, add action to sprite.

    "View" missing sine actions.

  • Comfirmed. I thought that was how it was supposed to be but thinking about it, there's no sense in those options not being available at runtime. Unless it's a technical issue.

  • These values are only applied the moment the object is created, then they're never used again. So it's impossible to use the proposed actions, because by the time you use one of these actions it's too late, the value being changed is never used.

    Workaround: use 'set period' or 'set magnitude' and apply the offset and randomness yourself. For example, set the magnitude to MyMagnitude + random(MyMagnitudeRandom).

  • But, what about offset?... you can't do those tricks :(

  • gameron: it works the same.

    You offset is simply a value, use global (constant) variable.

    Set the magnitude to MyMagnitude + (or -) MyOffset in the same way it was proposed in Ashley's post.

  • If you set an offset you have the same magnitude but start en different point. You cannot randomize the point you start if you cant modify the offset, can you?



    To add details... I spawn 3 enemies with this behavior and the first i want to be randomized and the rest I want to set the same offset.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • +1 on This.

    I'm generating strings of objects on the fly, and they're supposed to have a "snake like" motion, with the same exact parameters (magnitude and period needs to be the exact same one on all objects in a group) but with a time offset. Without access to the "offset" parameter I can't figure out a good way to do it.


  • I figured a way to do this, but had to use two timers (a short one for object generation, a long one to stop generating objects).

    Being able to access the offset would be much easier. Since the offset is only used when the object is created, maybe a "Reset" method could force the offset to be read at any point in the game?

    Here's a little example, using timers instead of the offset:

  • Hello. It lacks the "Compare value" condition.

    Useful for performing an action when the value reaches a certain value.


  • Hello. It lacks the "Compare value" condition.

    Useful for performing an action when the value reaches a certain value.



    As it states in the pinned link HERE, please do not respond to closed bug reports, especially ones from over 3 years ago.

    If you think you have a bug, create a new report ensuring you follow all of the Bug Report Requirements.

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