[SOLVED]Question about the Sine behavior.

0 favourites
  • 6 posts
  • Hello World,

    Can I use the sine behavior go get a bunch of objects to actually move in a wave pattern like seen in the first graph of this picture(that the manual links to by the way)?

    Cause I've been playing with this behavior for about 30 mins now, and I can't seem to get that result no matter what combination of settings I choose in the properties of the behavior.

    Thank you.

    LE: And if the answer is "No, you can't do that with the sine behavior." Does anyone please know how I could create that effect myself with events?

    LLE: In case it matters I guess I should olso tell you that the objects that I put the sine behavior on olso have the physics behavior, could there be some sort of conflict between the two?

  • You definitely can't mix movement behaviours with physics.

  • Then how could I achieve that type of movement while keeping my physics behavior?

    Oh, and fyi blackhornet , the sine behavior does seem to work fine alongside the physics behavior when it comes to a simple, continuous back and forth motion on a single axis.

    That is what I did first, and once I saw that worked, I assumed the wave motion would work as well, but like I said above, I can't seem to get that one to work....

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • VIKINGS, you need to cheat the physics behavior / think rather laterally - to get the results you want. Here's an example of using sine behavior to set the physics velocity of an object: capx.

    Edit to add that if your physics object sleeps then any movement will not be detected by the physics engine and all chaos will ensue (and to express continued dismay that kinematic bodies are not enabled....).

  • I took a look at your capx Colludium but I didn't understand what it was supposed to teach me or what it was adressing....

    Anyway a friend of mine solved it!:D Apparently in order to get that type of wave movement you have to add the sine behavior twice to the same object, once for the horizontal and once for vertical. Then you play around with the values of each and you can get a movement pretty much exactly like in that graph. Olso the physics behavior is still there, and so far there doesn't seem to be any conflicts, yaay.

    P.S. WTF happened to the forum?!?!?!? Is it a bug or did they change it? And if they did change it how can I revert back to the old one please?!

  • I guess I misunderstood your opening question. The capx just shows that there are ways to move and control physics objects in ways that don't cause physics glitches by using the physics properties.

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