Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
This project creates a Rope class a variety of different ways to support physics-enabled 2D ropes in Godot 4.
Godot 4 2D Rope Implementation
This project creates a Rope class a variety of different ways to support physics-enabled 2D ropes in Godot 4.
Example
Usage
See test/test_rope.gd for the example usage represented here:
Fixed on both ends
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)
Customize the length of each line segment
# Create a rope where each segment is 5 px long
rope = Rope.new($RopeStartPiece, 5)
Towards a particular point
rope.create_rope($RopeEndPiece2.global_position)
Towards a specific end piece, but only a certain length
# 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)
Grow the rope by five segments
rope.spool(5)
Draw a line over the rope
rope_drawer = RopeDrawSimpleLine.new(grope)
add_child(rope_drawer)
Stop drawing the line
rope_drawer.queue_free()
This project creates a Rope class a variety of different ways to support physics-enabled 2D ropes in Godot 4.
Reviews
Quick Information
This project creates a Rope class a variety of different ways to support physics-enabled 2D ropes in Godot 4.