Cog simulation

Get help using Construct 2

Post » Sun Jun 30, 2013 12:26 pm

Hi folks. I am looking to build a short series of cogs. The first will be powered, either with the rotate plugin or via a physics value, and the rest will respond and spin around like real cogs.

I am nearly there - the cogs are sprites with lots of points in the collision polygon (touch wood it hasn't slowed anything down) and I have each cog locked in place to an "immovable" polygon with a distance join.

I have the first cog moving and making the next cog spin, but as soon as they make contact they keep drifting away from each other, despite the distance join. messing with friction seems to have no effect.

Is there a way to constrain the movement to just spin on the spot, with no x or y movement at all? Or at least have them "bounce" back to their original position - actually, that would look cool.

I'm sure I am overlooking something obvious - can someone point me in the right direction?

Thanks,
Stevelowndsy2013-06-30 12:30:48
B
4
G
1
Posts: 2
Reputation: 779

Post » Sun Jun 30, 2013 12:57 pm

Not sure why you're using a distance joint. Revolute is what you want. Also, don't use the rotate behaviour; it'll mess with the physics stuff - rather apply torque. Also be sure to tweak your angular damping accordingly - that's their rotational friction, so to speak.

Here's an example (r136).

Damnit, now I want to make a physics puzzler :P
B
57
S
15
G
11
Posts: 912
Reputation: 12,596

Post » Sat Jul 06, 2013 2:38 pm

That's what I tried first, but I must have got something a bit off somewhere.

After I read this post I was able to replicate in r132 in a matter of minutes - thanks!
B
4
G
1
Posts: 2
Reputation: 779


Return to How do I....?

Who is online

Users browsing this forum: tikuna and 10 guests