This project creates a Rope class a variety of different ways to support physics-enabled 2D ropes in Godot 4.
See test/test_rope.gd for the example usage represented here:
Using the RopeEndPiece node as starting and/or end points, create a Rope that extends from that starting node to a specified ending node.
rope = Rope.new($RopeStartPiece)
add_child(rope)
rope.create_rope($RopeEndPiece) # rope_end_piece.global_position)# Create a rope where each segment is 5 px long
rope = Rope.new($RopeStartPiece, 5)rope.create_rope($RopeEndPiece2.global_position)# Create a rope that's 10 segments long that will connect to
# the $RopeEndPiece2 if it reaches it, but will otherwise float
rope.create_rope($RopeEndPiece2, 10)rope.spool(5)rope_drawer = RopeDrawSimpleLine.new(grope)
add_child(rope_drawer)rope_drawer.queue_free()