Pin Behavior: Is there a way to adjust the "stretch" of Rope/Bar?

Not favoritedFavorited Favorited 0 favourites
  • 9 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I'm working on a project that pins several parts together. Similar to a snake, where the head controls movement and each additional part is pinned.

    When doing this, there is an inherent "Stretch" effect that happens when speeding up and slowing down. It looks great, but my question is, is there a way to control that?

    Can I adjust how much stretch/pull I get when speeding up and slowing down?

    Thanks.

  • The "stretch" effect with Pin behavior is not intentional, it's basically a bug. Check out my comments in this post:

    construct.net/en/forum/construct-3/general-discussion-7/pinning-issues-147318

  • The "stretch" effect with Pin behavior is not intentional, it's basically a bug. Check out my comments in this post:

    https://www.construct.net/en/forum/construct-3/general-discussion-7/pinning-issues-147318

    Oh, well that stinks because it's exactly what I want to happen. If that bug ever gets fixed, I have no idea how to achieve it. Kind of wish there was a "Bungie" option for pin to go along with Rope and Bar.

    Maybe introducing Heirarchy fixed this bug. But there is no way to get that same effect with Heirarchy that I can find.

  • You can make the parts of snake body invisible. And move visible sprites to their position with lerp.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's a behaviorless way to do it.

    First chain tries to replicate the stretch from pinning to pinned objects.

    The rest order from head to tail with an adjustable stretch stiffness.

    dropbox.com/scl/fi/yzrr05uk5ch8fex2hrqrv/chain_stiffness.c3p

    Might be useful or give some ideas.

  • Here's a behaviorless way to do it.

    First chain tries to replicate the stretch from pinning to pinned objects.

    The rest order from head to tail with an adjustable stretch stiffness.

    https://www.dropbox.com/scl/fi/yzrr05uk5ch8fex2hrqrv/chain_stiffness.c3p?rlkey=zrmf55xltlcqht67inff5ic27&st=yuj5hlku

    Might be useful or give some ideas.

    Both are great options. It looks so smooth right now as it is, I hate to mess with it. haha. But I may need to resort to one of these two options.

    R0J0hound Very elegant solution, I would need to figure out how to make it work with the car behavior as the head and the other pieces trailing behind like it does when dragging. Also make it "squish" past default when decelerating. But a great starting point. Thanks.

  • You could replace the drag drop behavior with the car behavior and just disable it on all the instances but the head. Or just set the head instance (sprite.i=0) position to the car.

    Also currently it just pulls objects together if they are farther than 32 pixels apart. You can also make it push the objects apart if you remove the max from the move at an angle equation. I think that’s what you meant by squish together when braking.

  • You could replace the drag drop behavior with the car behavior and just disable it on all the instances but the head. Or just set the head instance (sprite.i=0) position to the car.

    Also currently it just pulls objects together if they are farther than 32 pixels apart. You can also make it push the objects apart if you remove the max from the move at an angle equation. I think that’s what you meant by squish together when braking.

    Thanks, I'll try that.

  • You could replace the drag drop behavior with the car behavior and just disable it on all the instances but the head. Or just set the head instance (sprite.i=0) position to the car.

    Also currently it just pulls objects together if they are farther than 32 pixels apart. You can also make it push the objects apart if you remove the max from the move at an angle equation. I think that’s what you meant by squish together when braking.

    Bringing this thread back for a quick question.

    R0J0hound

    What would be the easiest way, using LERP to resize all the sprites in the chain, but have them keep their relative space to the chain in front?

    Right now, if you just lerp (sprite.width, 0, 0.05) and lerp (sprite.height, 0, 0.05) they all resize great, but of course they resize from their origin point, so they create a gap between each sprite. As they shrink, the space gets bigger.

    Thanks.

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