Sine behavior - somebody please explain me simple thing

0 favourites
  • 13 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Can somebody help me?

    Situation is: Sine behavior on object and

    Movement -> vertical or horizontal (don't matter),

    Wave -> Sine,

    Magnitude - don't matter.

    I want make that object begin his cicle not from center, but from top or bottom (from left or from right - don't matter) for example. With out object "jumping". Just start from TOP (A), go throu middle (B), to BOTTOM (C) and back to top.

    ABC, CBA - DONE! HOW DO THIS?

    And i can't do this with any simple methods (Set cycle position - also "piece *ofs).

    Why just doesn't any parameter?

    Somebody?

    Ashly????

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I understand you correctly, that's what the period offset in the intital setup is for. Let's say you have a 4-second cycle. As you say, sines usually start from the center - your ABC analogy will go like this:

    B(0 seconds), C(1 second), B (2 seconds), A (3 seconds), back to B (completes the 4th second/back to 0)

    Therefore if you set the period offset to 3, you begin at A. Setting the offset to be exactly 75% (or three quarters) of the cycle duration will give the effect you want.

  • If I understand you correctly, that's what the period offset in the intital setup is for. Let's say you have a 4-second cycle. As you say, sines usually start from the center - your ABC analogy will go like this:

    B(0 seconds), C(1 second), B (2 seconds), A (3 seconds), back to B (completes the 4th second/back to 0)

    Therefore if you set the period offset to 3, you begin at A. Setting the offset to be exactly 75% (or three quarters) of the cycle duration will give the effect you want.

    I tested with the period. I'll try again. Thank you for having separated me for a minute.

  • If I understand you correctly, that's what the period offset in the intital setup is for. Let's say you have a 4-second cycle. As you say, sines usually start from the center - your ABC analogy will go like this:

    B(0 seconds), C(1 second), B (2 seconds), A (3 seconds), back to B (completes the 4th second/back to 0)

    Therefore if you set the period offset to 3, you begin at A. Setting the offset to be exactly 75% (or three quarters) of the cycle duration will give the effect you want.

    https://www.dropbox.com/s/6mmml3kf3vghham/Screenshot_2.png

    There are some such malfunctions. Sine Behavior in my situation, I would have to be inactive on start ... However, I used a period offset and a curved workaround in events, I almost got what I wanted.

    p.s. maybe you should advise how to avoid workaround in event sheet?

  • Hmm, I'm not sure I follow what the 0.1 sec delay is designed to do? What was the malfunction exactly?

  • Hmm, I'm not sure I follow what the 0.1 sec delay is designed to do? What was the malfunction exactly?

    If i set Sine behavior "Inactive On Start" - everything works, but when i actived Sine, object JUMP to period offset. And then begin moving.

  • Okay, I played with it a bit. Have your Sine object set to be Active on start, and then in events do:

    Start of level: set cycle position to 0.75, set Sine inactive.

    Sine object will begin the level in position A and then start moving smoothly when activated.

  • Okay, I played with it a bit. Have your Sine object set to be Active on start, and then in events do:

    Start of level: set cycle position to 0.75, set Sine inactive.

    Sine object will begin the level in position A and then start moving smoothly when activated.

    I did not succeed.

    Do not waste your time. But if you look for another minute, look at "capx" (Construct 2) - I'll be grateful.

    p.s. I left only what might be needed. Look at the last lines

    https://www.dropbox.com/s/vxg1q90udyyro ... tures.capx

    Thank you

  • Here you go, this is all you need to do. I think your For-Each loop was messing it up.

    I always have time to try to help people, if I know how

  • Object still "jumping"... Unsuccess. Whatever Mike.

  • Just use some workaround Like this:

    On layout Start -> Wait 0.1s; SineDeActive; - here saturated period offset.

    By the way (This one not working -> OnObjectWithSineCreate -> SineDeActive; ) - Object stay in same place, not saturated period offset.

  • Ouuu, problems was in my Construct 2 version (239), yours version is 244.

    Thanks for spending time Mike!!!

  • Solution with Mike help and C2 update to 244 or newer version is simple:

    or link cause "?raw=1" not work Ethan

    https://www.dropbox.com/s/9dbpfxn7tlhvwxt/Screenshot_4.png

    Happy End

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