Cog simulation

0 favourites
  • 3 posts
  • 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,

    Steve

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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!

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