How do make a swinging rope ? Pin + Physics ?

0 favourites
From the Asset Store
Blade Swings And Hits
$10.85 USD
30% off
140 sounds, specially designed to make your blades sound amazing
  • Hi, can anyone help me find out how to use the PIN behavior to create a ROPE, but make it with physics? I got a little close to it the project below:

    drive.google.com/file/d/19RnBaYDcR0FaG10uR_3VijwDR3H2lA-R/view

    (use left/right to move the main block)

    But it seems like the pinned objects will only "remember" physics when the Main object they are attached to is moving... I'd like to have a rope with natural swing effects, with this weight on the tip, like a chain holding a wrecking ball.

    Please check my .c3p file and give me some light

    Thank you

  • Don't use pin with physics, set physics joints instead.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, so I did search the forum here and there are lots of topics about it, but all examples I found the rope goes crazy depending on the distance:

    I actually would like to create something like a fishing line attached to a boat, or fisherman on a boa, the boat moves left/right, the line can be little dots connected together in a rope swing style, it doesnt really need to look like a real line, and there's the hook at the end of the line,

    the hook and the line should move along with the boat pulling the line, but in a 0 zero gravity under water like environment...

    the line should have some elastic stretch-slack but alwaus return slowing to the minimum distance...

    anyone kind enough to make an example?

  • I found this bungee jump example that is a bit more of what I have in mind, but the rope be made of around 20 dots or more... and they all are connected

    this example someone created join for each part of the rope, only 3 parts, but that would be 20 or more actions for me...

    construct.net/out

  • Physics joints don't like to be "abused", you should not apply big forces or impulses to them. And definitely don't try adding other behaviors like drag&drop, pin etc. You should move/rotate physics objects only with physics actions.

    If you need a straight line, like a fishing line, then maybe you don't need physics at all. Just use a long sprite, change its width and angle.

  • thank you for the info dop2000 I'll try some more testing...

    I dont want a straight line, it has to move according to the hook, it can form curves but should never break, the hook will be light and should bounce around under water in a low gravity state and also be pulled by the line, which is attached to the boat, and move around from the tangle. Should all be a natural movement...

    When a buttom is pressed, the hook would Pin whatever sprite is in contact with it, and force up to be applied to the hooked sprite can fly up to the boat...

    i can picture clearly in my head, but cannot reproduce it...

  • If you want a very natural moving flexible line, then I'm afraid there is no easy solution. You can use a rope made with physics joints, but be careful not to break it - don't apply extreme forces, don't change position/angle directly, don't use pin etc.

    You can also bend a straight sprite with mesh distortion, but there is a lot of math involved..

  • I'm trying to reproduce a game I used to play on pc in the 90's... very simple 2mb.exe, I don't think they used very complicated features for that game...

    maybe I could send the game for you or someone that could try it and compare to C3 features?

  • What's the name of that game?

  • Alternatively to using the physics behavior you can do some event based physics. Gives endless things you can tweak to give better results at times.

    You can find more info about this method online by looking up "verlet rope physics".

    Anyways, this roughly follows that with additional tweaks.

    The collision detection was probably the most math. I kind of liked the effect of the chain pulling the player, but you can tweak the mass in event 2 to make the player less or more affected.

    dropbox.com/s/p9fdgbpk59dvc4h/verlet_4.capx

  • R0J0hound Man I think that was the best example to show up so far here in the Forum! Thanks a lot! That is just perfect, I will try to adjust it so the physics are like less gravity, but from what I saw the rope has a very natural swing and looks unbreakable, doesnt matter how much the square moves. Thanks again

    dop2000 its a very old japanese game, cannot find anymore online,I have kept the file since I was a teen

  • R0J0hound can't believe there's no Physics behavior involved... this is genius... far from my understanding, but I'll try to tweak it up

  • Ah, you must have edited your post, I thought you posted a link.

    You can think of the rope as a purely visual effect and just move the hook up and down by other means.

    Here's a stripped down version without the collision detection and other extras. It just puts a rope between two sprites with drag and drop. Also added line sprites between the points for added visual. I put settings variables at the top so you can adjust the distance between points, gravity, and fluid friction.

    dropbox.com/s/z8u9sper7u3b6ya/rope.capx

  • I think lots and lots of people who were struggling to get a "steady" and strong, natural, rope, were actually just looking for these "visual effects", they are amazing.

    Yes I have removed last post because it was irrelevant already, I was changing the "mass" value of the weight and nothing was happening, but then I changed something else in the math events and got the gravity I wanted.

    Could I contact you directly maybe just for some key questions? DM or email? You're the one that can help me out, and have already

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