How to make a springy wobbler?

0 favourites
  • 2 posts
  • This wobbler should... wobble and also stretch by centrifugal force, but tend to return to its initial angle, length and curve, like a spring does. Is the physics the only way?

    I'm able to create a straight "line" from sprites with physics, that behave pretty much like this, but I can't realize how to give a proper angle to each piece, so they will form a curve line like on the image "at rest".

    The second problem is I'd like only the load-tip (a ball on the wobbler's end) to collide with other objects, but not the wobbler's "line" itself, collisions should be disabled for the "line" - and that seems impossible using physics?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there any game with such a thing?

    If you did it straight, then just do it curved. Place multiple sections down, each angled a bit more, then create the joints.

    Look again at the actions of the physics behavior. You can disable physics collisions between objects.

    Or you could just have the end have physics with a spring joint moving it back into place and have the the rest just be sprites without physics positioned in a curve with qarp() or something.

    I don’t even know if the physics behavior has a spring joint. Anyways you could do a spring by constantly applying a force toward a rest position.

    ForceX = -k*(self.x-restx)/dt-b*self.velocityX

    And the same for y force, just with y stuff. K and b are the spring stiffness and damping. Usually in the range of 0 to 1 but you’ll just have to fiddle with it. Probably will want to put that under a condition of dt>0 since dt can be 0 which would give infinite force.

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