How to create grappling hook or 3d rope

I want to make a 3d game with grappling hook mechanics - but not just the usual acceleration to the aiming point - but so that the rope also has its own physics - to be honest, I don’t even know where to start - maybe there are some 3d examples with something similar?

Hi @LASTY!

Have you a good level with GDevelop and games engines in general?

I ask this question because your project is quite strong.

A+
Xierra

  • Create the rope segments by modeling tiny 3D cylinders in Blender. Make them very thin, with equal width, height, and depth so the rope looks clean and consistent. Apply the scale and export the cylinder as a .glb file, then import it into GDevelop as a 3D object.

  • Add 3D Physics to the cylinder. Lower the mass so the rope feels light, and choose static object type for a stiff rope.

  • Set up the rope behavior so each segment follows the center of the segment before it. For every segment except the first, calculate the direction from the current segment toward the previous one, normalize that direction, move the segment toward the previous segment’s center, and offset it slightly backward by the segment length to keep tension.

    Tip All the segments should have a variable with values of ascending numbers to keep track of which is ahead of another

  • Rotate each segment so it faces the segment ahead of it. This keeps the rope visually straight and aligned.

  • Attach the first segment to the player. Update its position every frame so it sticks to the player, and let the rest of the segments follow naturally.

  • Cast a ray when the player fires the grappling hook. Use the camera or aim direction to detect the hit point. Save that position, measure the distance from the player, and create enough rope segments to span that distance.

  • Lay out the rope by positioning all the segments in a straight line between the player and the hook point. Divide the direction vector by the number of segments and place each one along that line.

  • Apply optional forces to give the rope more life. Pull the player slightly toward the second segment for swinging motion, or push rope segments back a bit to simulate tension.

  • Render the rope cleanly by scaling and rotating each cylinder so it visually connects to the next. When everything updates together, the rope looks continuous, flexible, and dynamic.

1 Like

u used ai to generate that right?

I told AI how to do it, it just helped me refine the grammer.

1 Like

use grammarly i have it

@dskyle7 Grammar.

I know English might not be your first language.

1 Like

It actually is, but it was twisted in my country

hi - one year only in gdevelop 5 but in 3d zero experience.

Hi @LASTY!

If you are sufficiently motivated, it should be fine.

A+
Xierra