How do I keep two objects using Sine in sync?

Get help using Construct 2

Post » Fri Dec 12, 2014 9:29 am

Quick question....
I've got a sprite onscreen that uses a sine movement to make it bob up and down.
I wanted to overlay another sprite that acts like a pattern or design over the first sprite. I've set the sine movement to exactly the same parameters as the first and used an overlay effect on a higher layer but it keeps going out of sync.
Is there something I'm missing? Any suggestions on what I should be keeping in mind?
Cheers
B
7
Posts: 33
Reputation: 341

Post » Fri Dec 12, 2014 11:40 am

Make sure all of the random modifiers are at 0
(period random, period offset random, and magnitude random) these will add a random value based on the number entered to give each sine a slight difference.
B
25
S
7
G
1
Posts: 83
Reputation: 2,550

Post » Fri Dec 12, 2014 12:12 pm

pattern.Y≠sprite.Y ...set pattern.Y =sprite.Y
Image
B
65
S
23
G
7
Posts: 1,502
Reputation: 10,890

Post » Fri Dec 12, 2014 6:06 pm

What about using the "Pin" behavior?
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Fri Dec 12, 2014 6:59 pm

Thanks for the tips, guys.
Yeah, I'm using the Pin Behaviour and I'm 90% sure all the random modifiers are at 0.
I originally thought slight differences in sprite 1 and 2s collision boxes was throwing the sync out but I noticed it would just go out on its own free will from time to time.
B
7
Posts: 33
Reputation: 341

Post » Fri Dec 12, 2014 8:43 pm

Try and turn collisions off for pattern
B
38
S
18
G
19
Posts: 664
Reputation: 14,107


Return to How do I....?

Who is online

Users browsing this forum: charliesan763 and 16 guests