[SOLVED]Question about the Sine behavior.

Get help using Construct 2

Post » Tue Jun 30, 2015 9:49 pm

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?
Last edited by VIKINGS on Thu Aug 06, 2015 12:45 pm, edited 1 time in total.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Tue Jun 30, 2015 9:59 pm

You definitely can't mix movement behaviours with physics.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Tue Jun 30, 2015 10:38 pm

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....
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Wed Jul 01, 2015 1:05 am

@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....).
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Wed Jul 01, 2015 2:47 pm

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?!
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Wed Jul 01, 2015 3:24 pm

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.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 43 guests