# Joint Chain Rope System Script Usage Guide

Joint Chain Rope System Script Usage Guide (BreakableJointMonitor2D, RopePathBinder2D, ChainPathBinder2D, ChainJointSetupTool, ChainPartResource, JointBreakParams, AreaJointBreaker2D, RigidBodyPusherNatural)

chain_joints_scripts.zip (24.1 KB)

By using this set of scripts, you can monitor and sever physical joints (PinJoint2D, GrooveJoint2D) and visualize the shape of ropes or chains as a Path2D.

You can freely configure joint break conditions, automatic chain setup, and rope path generation.

0. Terminology

|Term|Meaning|

| — | — |

|Joint|PinJoint2D or GrooveJoint2D (connection between physical bodies)|

|Monitor|BreakableJointMonitor2D (monitors and determines joint breakage)|

|RopePathBinder|RopePathBinder2D (generates Path2D from a sequence of rope nodes)|

|ChainPathBinder|ChainPathBinder2D (manages chain structure and splits paths upon breakage)|

|ChainPart|ChainPartResource (chain part information: RigidBody2D and seg nodes)|

|SetupTool|ChainJointSetupTool (automatic setup tool for chain joints)|

|AreaBreaker|AreaJointBreaker2D (bulk severs Joint2Ds within an Area2D range)|

|JointBreakParams|JointBreakParams (individual break parameters per joint)|

|seg node|Node markers for segments within each RigidBody2D (e.g., seg1, seg2)|

|RigidBodyPusher|RigidBodyPusherNatural (CharacterBody2D pushes RigidBody2D)|


1. Setup (Creating a “Working State”)

1-1. Creating a Basic Chain Structure

Objective

To use the chain system, you must first link multiple RigidBody2Ds together. You can create them manually or generate them automatically using ChainJointSetupTool.

Setup Steps (Manual)

  1. Place a Node2D in the scene (e.g., ChainRoot)

  2. Place multiple RigidBody2Ds as children (e.g., Link1, Link2, Link3…)

  3. Add CollisionShape2D and Sprite2D to each RigidBody2D

  4. Add a Node2D as a child to each RigidBody2D and name them seg1, seg2, etc. (used as connection points)

Setup Steps (Automatic: Using ChainJointSetupTool)

  1. Place a Node2D in the scene

  2. Attach chain_setup_tool.gd

  3. Set target_parent to the parent node of the chain (if not set, uses this node’s parent)

  4. Check _setup_button in the Inspector or call setup_chain()

  5. Child RigidBody2Ds are automatically detected, and Joints and seg nodes are generated

In the Sample

  • If auto_setup_all=true, BreakableJointMonitor2D, ChainPathBinder2D, Path2D, and PathRibbonMesh2D are automatically generated

1-2. Setting Up Joint Monitoring (BreakableJointMonitor2D)

Objective

To automatically sever joints when certain conditions are met, place BreakableJointMonitor2D to start monitoring.

Setup Steps

  1. Place a Node in the scene

  2. Attach breakable_joint_monitor_2d.gd

  3. Set search_root to the root node of the targets to monitor (if not set, uses the parent node)

  4. Set break conditions (e.g., break_relative_speed, pin_break_error_pixels, etc.)

  5. If auto_collect_on_ready=true (default), joints are automatically collected on startup

In the Sample

  • Automatic collection with auto_collect_on_ready=true

  • Re-collection after break with recollect_after_break=true


1-3. Setting Up Rope/Chain Visualization

Objective

Visualize the shape of physically moving ropes or chains as a Path2D. Use RopePathBinder2D or ChainPathBinder2D.

Setup Steps (RopePathBinder2D: For Ropes)

  1. Place a Node in the scene

  2. Attach rope_solver.gd

  3. Set source_mode:

  • NODEPATH_LIST: Explicitly specify node paths in point_node_paths

  • CHILDREN_RECURSIVE: Auto-detect from descendants (specify type with child_filter_mode)

  1. Add Path2D to output_paths (auto-generated if empty)

  2. Updates automatically if auto_update=true

Setup Steps (ChainPathBinder2D: For Chains)

  1. Place a Node in the scene

  2. Attach chain_path_binder.gd

  3. If auto_detect_mode=true, RigidBody2Ds under search_root are automatically detected

  4. Or manually add ChainPartResource to chain_parts

  5. If joint_monitor is set to BreakableJointMonitor2D, paths are automatically split upon breakage

  6. Add Path2D to output_paths (auto-generated if empty)

In the Sample

  • Updates in the physics frame with auto_update=true and update_in_physics=true

1-4. Setting Up CharacterBody2D to Push RigidBody2D (RigidBodyPusherNatural)

Objective

Add functionality for a CharacterBody2D to naturally push contacted RigidBody2Ds when moving via move_and_slide().

Setup Steps

  1. Add a Node as a child of CharacterBody2D

  2. Attach rigid_body_pusher.gd

  3. Set pusher_physics_priority (set a larger value to execute after move_and_slide(), default: 1000)

  4. Adjust push strength and mass consideration

In the Sample

  • Applies force every frame with use_force=true

  • Considers mass with consider_mass=true

  • Wakes up RigidBody2D upon contact with wake_rigid_bodies=true


1-5. Bulk Severing Joints Within Area2D Range (AreaJointBreaker2D)

Objective

A feature to bulk sever joints within a specific range (Area2D). Can be used for effects like cutting with a sword or an explosion.

Setup Steps

  1. Prepare an Area2D for the cutting range and add a CollisionShape2D as a child

  2. Attach area_joint_breaker.gd to any node

  3. Set the above Area2D to target_area

  4. Set BreakableJointMonitor2D to monitor (optional; if set, the joint_broken signal is emitted)

  5. Call break_joints_in_target_area()

In the Sample

  • Can be executed by checking _break_now_button in the editor

2. Execution (How It Works)

2-1. Automatic Joint Severing

Processing Flow

  1. BreakableJointMonitor2D monitors each joint in _physics_process

  2. If break conditions are met, it waits for break_delay_frames (or break_delay_sec)

  3. If conditions persist, it severs the joint via joint.queue_free() and emits the joint_broken signal

  4. If recollect_after_break=true, joints are re-collected after severing

Examples of Break Conditions

  • pin_break_error_pixels: Anchor error exceeds specified pixels

  • break_relative_speed: Relative speed exceeds specified value

  • break_stretch_ratio: Stretch ratio relative to initial distance exceeds specified value

  • break_angle_degrees + break_angle_duration_sec: Angle exceeds specified degrees for a certain duration

Operation in Sample

  • Joints are automatically severed when pulled or when the angle becomes large

2-2. Rope/Chain Path Update

Processing Flow

  1. RopePathBinder2D or ChainPathBinder2D collects the node sequence in _physics_process

  2. Converts each node’s global_position to local coordinates for Path2D

  3. Clears Curve2D and adds the new point sequence

  4. Optionally applies resampling, smooth handles, and endpoint offsets

  5. Emits the paths_updated signal (used in PathRibbonMesh2D, etc.)

Automatic Splitting During Chain Breakage

  1. ChainPathBinder2D receives the joint_broken signal

  2. Retrieves body_a and body_b of the severed joint

  3. Rebuilds the connection graph and detects connected components

  4. Generates and updates Path2D for each connected component

Operation in Sample

  • As the rope/chain moves physically, Path2D follows to visualize the shape

  • When a joint breaks, the path is automatically split


2-3. RigidBody2D Pushing

Processing Flow

  1. RigidBodyPusherNatural executes in _physics_process (execution order controlled by pusher_physics_priority)

  2. Retrieves collisions via the parent’s CharacterBody2D.get_slide_collision_count()

  3. If the collision partner is a RigidBody2D, calculates the push force

  4. Determines push direction by combining normal direction and movement direction

  5. Applies force via apply_central_force() or apply_central_impulse()

Operation in Sample

  • When CharacterBody2D contacts a RigidBody2D like a box, it is naturally pushed out

3. Configuration Items (Main Parameters)

3-1. BreakableJointMonitor2D Configuration

|Item|Purpose (What it affects)|Default|

| — | — | — |

|search_root|Root node to search for targets|Parent node|

|break_relative_speed|Break candidate if relative speed exceeds this value|0.0 (Disabled)|

|pin_break_error_pixels|Break if anchor error exceeds this pixel amount|0.0 (Disabled)|

|break_stretch_ratio|Break if stretch ratio relative to initial distance exceeds this value|0.0 (Disabled)|

|break_stretch_duration_sec|Break if stretched for this many seconds or more|0.0 (Disabled)|

|break_angle_degrees|Break after a certain time if angle exceeds this value|0.0 (Disabled)|

|break_angle_duration_sec|Break if angle exceeds for this many seconds or more|0.5|

|use_break_delay_frames|Treat BreakDelay as frames (Recommended)|true|

|break_delay_frames|Break if exceeded continuously for this many frames|1|

|auto_collect_on_ready|Auto-collect on startup|true|

|recollect_after_break|Auto-re-collect after break|true|

Supplementary (Typical reasons for not breaking)

  • Break condition values are 0.0 (Disabled)

  • break_delay_frames is too large

  • search_root is not set correctly

  • Joints are included in exclude_groups


3-2. RopePathBinder2D / ChainPathBinder2D Configuration

|Item|Purpose (What it affects)|Default|

| — | — | — |

|auto_update|Auto-update (updates every frame if true)|true|

|update_in_physics|Update in physics frame|true|

|min_point_distance_px|Do not add points that are too close|0.0 (Disabled)|

|max_points|Maximum number of points|0 (Unlimited)|

|resample_spacing_px|Resample point sequence at fixed intervals|0.0 (Disabled)|

|enable_smooth_handles|Smooth Curve2D handles|false|

|start_point_offset_local|Start point offset|Vector2(0, 0)|

|end_point_offset_local|End point offset|Vector2(0, 0)|

Supplementary (Typical reasons for path not updating)

  • auto_update=false

  • output_paths is empty

  • Nodes are not collected (check source_mode or search_root settings)


3-3. ChainJointSetupTool Configuration

|Item|Purpose (What it affects)|Default|

| — | — | — |

|target_parent|Parent node for setup|Parent node|

|joint_type|Type of Joint to use (GROOVE/PIN)|GROOVE|

|groove_length|Length of GrooveJoint2D|8.0|

|auto_create_seg_nodes|Auto-generate seg nodes for each RigidBody2D|true|

|auto_setup_all|Auto-generate and set all nodes|true|

|setup_on_ready|Auto-setup on execution|false|

Supplementary (Typical reasons for setup failure)

  • Less than two RigidBody2Ds under target_parent

  • Existing Joints not properly removed


3-4. RigidBodyPusherNatural Configuration

|Item|Purpose (What it affects)|Default|

| — | — | — |

|pusher_physics_priority|Physics processing priority (higher means later)|1000|

|require_owner_motion|Push only when parent moves|false|

|use_force|Force method (true recommended)|true|

|push_strength|Push strength coefficient|100.0|

|min_push_force|Minimum push force|50.0|

|consider_mass|Consider mass|true|

|mass_influence|Mass influence (0.0-1.0)|0.5|

|normal_direction_weight|Weight of force in normal direction|0.7|

|movement_direction_weight|Weight of force in movement direction|0.3|

Supplementary (Typical reasons for not pushing)

  • require_owner_motion=true and parent is not moving

  • min_push_force is too small

  • consider_mass=true and the target is too heavy


4. Modification Steps (Common Use Cases)

4-1. Adjusting Joint Break Conditions

Objective

Set joints to be more sensitive or more robust.

Steps

  1. Select BreakableJointMonitor2D

  2. Adjust break condition values:

  • To make more sensitive: Lower break_relative_speed, set break_delay_frames to 1

  • To make more robust: Raise break_relative_speed, increase break_delay_frames

  1. If individual settings are needed, add JointBreakParams resource to joint_params

Example of Individual Settings

  1. Create JointBreakParams as a resource

  2. Set the NodePath of the target joint to joint_path

  3. Set individual break parameters (-1.0 uses global settings)

  4. Add to joint_params of BreakableJointMonitor2D


4-2. Adjusting Rope/Chain Appearance

Objective

Adjust path smoothness and point density.

Steps

  1. Select RopePathBinder2D or ChainPathBinder2D

  2. Set resample_spacing_px to make point sequence uniform (e.g., 8.0)

  3. Set enable_smooth_handles=true to make Curve2D smoother

  4. Set min_point_distance_px to thin out points that are too close


4-3. Increasing Chain Segments

Objective

Create a longer chain.

Steps

  1. Add RigidBody2D under the chain’s parent node

  2. Re-run setup_chain() of ChainJointSetupTool

  3. Or manually add GrooveJoint2D/PinJoint2D


4-4. Adjusting Push Strength

Objective

Change the strength with which CharacterBody2D pushes RigidBody2D.

Steps

  1. Select RigidBodyPusherNatural

  2. Adjust push_strength (higher means stronger push)

  3. Adjust min_push_force (to push boxes on the ground)

  4. Adjust mass_influence (closer to 0.0 ignores mass)


5. Troubleshooting

|Symptom|Main Cause|Solution|

| — | — | — |

|Joints do not break|Break conditions are 0.0 (Disabled)|Set break_relative_speed etc. to valid values|

|Joints break immediately|Break conditions are too strict|Raise break_relative_speed, increase break_delay_frames|

|Path not updating|auto_update=false|Set auto_update=true|

|Path not displaying|output_paths is empty|Add Path2D or wait for auto-generation|

|Chain not set up|Less than two RigidBody2Ds|Place two or more RigidBody2Ds under the parent node|

|Pushing not working|require_owner_motion=true and parent is stopped|Set require_owner_motion=false or move the parent|

|Not severing in Area2D|target_area not set|Set Area2D to target_area|

|Individual settings not working|joint_path is incorrect|Re-set joint_path or check relative path from search_root|


6. Script Overview

6-1. BreakableJointMonitor2D

BreakableJointMonitor2D is a Node script that monitors PinJoint2D and GrooveJoint2D in the scene and automatically severs them when specified conditions are met.

Features

  • Common break conditions for Pin/Groove (relative speed, stretch ratio, angle, time-based stretch)

  • Pin-specific break conditions (anchor error)

  • Groove-specific break conditions (out of range, pulling at ends)

  • Individual settings per joint (JointBreakParams)

  • Frame-based/second-based break delay

  • Auto-collect and re-collect functions

Prerequisites and Requirements

  • Assumes Godot 4 series 2D node structure

  • Targets are PinJoint2D and GrooveJoint2D under search_root

  • Nodes included in exclude_groups are not monitored

Properties List

|Property|Type / Default|Description|

| — | — | — |

|search_root|NodePath / Empty|Root node to search for targets|

|exclude_groups|Array[String] / []|Group names to exclude from monitoring|

|break_relative_speed|float / 0.0|Break candidate if relative speed exceeds this value (0 means disabled)|

|pin_break_error_pixels|float / 0.0|Break if anchor error exceeds this pixel amount (0 means disabled)|

|break_stretch_ratio|float / 0.0|Break if stretch ratio relative to initial distance exceeds this value (0 means disabled)|

|break_stretch_duration_sec|float / 0.0|Break if stretched for this many seconds or more (0 means disabled)|

|stretch_threshold_ratio|float / 1.1|Stretch judgment threshold (ratio relative to initial distance)|

|break_angle_degrees|float / 0.0|Break after a certain time if angle exceeds this value (0 means disabled)|

|break_angle_duration_sec|float / 0.5|Break if angle exceeds for this many seconds or more|

|groove_break_out_of_range_pixels|float / 0.0|Break if anchor position goes out of groove range (0 means disabled)|

|groove_break_end_pull_speed|float / 0.0|Break if relative speed pulling outward at end exceeds this value (0 means disabled)|

|groove_end_epsilon_pixels|float / 2.0|Allowance for end judgment (pixels)|

|joint_params|Array[JointBreakParams] / []|Individual settings per joint|

|use_break_delay_frames|bool / true|Treat BreakDelay as frames (Recommended)|

|break_delay_frames|int / 1|Break if exceeded continuously for this many frames|

|break_delay_sec|float / 0.0|Break if exceeded continuously for this many seconds (Old method)|

|over_time_decay_sec|float / 0.0|Counter decay time when exceeded condition stops|

|auto_collect_on_ready|bool / true|Auto-collect on startup|

|recollect_interval_sec|float / 0.0|Re-collect at fixed intervals (0 means never)|

|recollect_every_frame|bool / false|Always re-collect every frame|

|recollect_after_break|bool / true|Auto-re-collect after break|

|debug_print_eval|bool / false|Output judgment logs|

Signals

  • joint_broken(joint: Joint2D, reason: String): Emitted when a joint is severed

  • joint_registered(joint: Joint2D): Emitted when a joint is registered

  • joint_unregistered(joint: Joint2D): Emitted when a joint is unregistered

Public Methods

  • collect_joints(): Manually collect joints

  • break_joint(joint: Joint2D, reason: String = "manual"): Manually sever a joint


6-2. RopePathBinder2D

RopePathBinder2D is a Node script that reconstructs the Curve2D of Path2D every frame to match the current shape of the “rope (node sequence)”.

Features

  • Nodes can be any Node2D (RigidBody2D, Bone2D, CharacterBody2D, Marker2D, etc.)

  • Collection methods: Explicit NodePath / Descendant search (type filter)

  • Output: Update multiple Path2Ds

  • Point thinning / Simple handles / Fixed interval resampling

  • Automatic path splitting during rope breakage

Prerequisites and Requirements

  • Nodes must be Node2D

  • Path2D is added to output_paths or auto-generated

Properties List

|Property|Type / Default|Description|

| — | — | — |

|output_paths|Array[Path2D] / []|Array of Path2Ds to generate/update|

|auto_update|bool / true|Auto-update (updates every frame if true)|

|update_in_physics|bool / true|Update in physics frame|

|source_mode|enum / NODEPATH_LIST|NODEPATH_LIST / CHILDREN_RECURSIVE|

|point_node_paths|Array[NodePath] / []|Used when source_mode==NODEPATH_LIST|

|child_filter_mode|enum / ANY_NODE2D|Type filter in descendant search|

|preserve_found_order|bool / true|Preserve order in descendant search|

|search_root|Node / null|Base point for descendant search|

|auto_split_on_break|bool / true|Automatically split paths on rope breakage|

|joint_monitor|BreakableJointMonitor2D / null|Receives joint_broken signal|

|path_parent|Node / null|Parent node of generated Path2D|

|min_point_distance_px|float / 0.0|Do not add points that are too close (0.0 means disabled)|

|max_points|int / 0|Maximum number of points (0 means unlimited)|

|start_point_offset_local|Vector2 / (0, 0)|Start point offset|

|end_point_offset_local|Vector2 / (0, 0)|End point offset|

|resample_spacing_px|float / 0.0|Resample point sequence at fixed intervals (0.0 means disabled)|

|enable_smooth_handles|bool / false|Smooth Curve2D handles|

|smooth_handle_strength_px|float / 12.0|Handle strength (px)|

|weaken_end_handles|bool / true|Weaken end point handles|

Signals

  • paths_updated(paths: Array[Path2D]): Emitted when paths are updated

Public Methods

  • update_paths_from_rope(): Manually update paths

6-3. ChainPathBinder2D

ChainPathBinder2D is a Node script that manages the chain structure and automatically splits paths upon joint breakage.

Features

  • Flexible setting of seg nodes within each chain part (RigidBody)

  • Auto-detect mode (auto-detects RigidBody2Ds under search_root)

  • Builds joint connection graph and generates paths for each connected component

  • Automatically splits paths upon breakage

Prerequisites and Requirements

  • Chain parts are defined by ChainPartResource

  • If auto_detect_mode=true, RigidBody2Ds under search_root are auto-detected

Properties List

|Property|Type / Default|Description|

| — | — | — |

|auto_detect_mode|bool / false|Auto-detect mode (auto-detects if true)|

|search_root|Node / null|Search start node|

|seg_node_prefix|String / "seg"|Naming convention prefix for seg nodes|

|use_rigidbody_as_seg_when_no_seg|bool / true|Use RigidBody2D itself as seg if no seg node exists|

|chain_parts|Array[ChainPartResource] / []|Array of chain parts|

|output_paths|Array[Path2D] / []|Array of Path2Ds to generate/update|

|auto_update|bool / true|Auto-update|

|update_in_physics|bool / true|Update in physics frame|

|joint_monitor|BreakableJointMonitor2D / null|Receives joint_broken signal|

|path_parent|Node / null|Parent node of generated Path2D|

|ribbon_mesh|PathRibbonMesh2D / null|Direct function call on path update|

|min_point_distance_px|float / 0.0|Do not add points that are too close|

|max_points|int / 0|Maximum number of points|

|start_point_offset_local|Vector2 / (0, 0)|Start point offset|

|end_point_offset_local|Vector2 / (0, 0)|End point offset|

|resample_spacing_px|float / 0.0|Resample point sequence at fixed intervals|

|enable_smooth_handles|bool / false|Smooth Curve2D handles|

|smooth_handle_strength_px|float / 12.0|Handle strength|

|weaken_end_handles|bool / true|Weaken end point handles|

Public Methods

  • update_paths_from_chain(): Manually update paths

6-4. ChainJointSetupTool

ChainJointSetupTool is an automatic setup tool for chain joints.

Features

  • Auto-detects child RigidBody2Ds

  • Generates joints sequentially (GrooveJoint2D or PinJoint2D)

  • Auto-generates seg nodes

  • Auto-setup of all nodes (BreakableJointMonitor2D, ChainPathBinder2D, Path2D, PathRibbonMesh2D)

Prerequisites and Requirements

  • Requires two or more RigidBody2Ds under target_parent

  • Since it is a @tool script, it can be executed in the editor

Properties List

|Property|Type / Default|Description|

| — | — | — |

|target_parent|Node / null|Parent node for setup|

|joint_type|enum / GROOVE|Type of Joint to use (GROOVE/PIN)|

|groove_length|float / 8.0|Length of GrooveJoint2D|

|groove_initial_offset|float / 1.0|Initial offset of GrooveJoint2D|

|groove_joint_position_local|Vector2 / (0, -16)|Position of GrooveJoint2D|

|pin_joint_position_local|Vector2 / (0, 0)|Position of PinJoint2D|

|disable_collision|bool / false|Disable collision for joints|

|bias|float / 0.9|Joint bias|

|auto_create_seg_nodes|bool / true|Auto-generate seg nodes for each RigidBody2D|

|seg_node_prefix|String / "seg"|Prefix for seg nodes|

|seg1_position_local|Vector2 / (0, -10)|Position of seg1|

|seg2_position_local|Vector2 / (0, 10)|Position of seg2|

|auto_setup_all|bool / true|Auto-generate and set all nodes|

|auto_connect_breakable_monitor|bool / true|Auto-connect to BreakableJointMonitor2D|

|breakable_monitor_path|NodePath / ""|Path to BreakableJointMonitor2D|

|auto_setup_chain_binder|bool / true|Auto-setup for ChainPathBinder2D|

|chain_binder_path|NodePath / ""|Path to ChainPathBinder2D|

|setup_on_ready|bool / false|Auto-setup on execution|

|_setup_button|bool / false|Button to execute from Inspector|

Public Methods

  • setup_chain(): Set up the chain

6-5. ChainPartResource

ChainPartResource is a Resource class that holds chain part information.

Properties List

|Property|Type / Default|Description|

| — | — | — |

|rigid_body_path|NodePath / NodePath()|RigidBody2D of this chain part (NodePath)|

|seg_node_paths|Array[NodePath] / []|Seg nodes within this part (Array of NodePaths)|


6-6. JointBreakParams

JointBreakParams is a Resource class that holds individual break parameters per joint.

Properties List

|Property|Type / Default|Description|

| — | — | — |

|joint_path|NodePath / NodePath()|Target joint (NodePath)|

|break_relative_speed|float / -1.0|Relative speed (-1 uses global settings)|

|pin_break_error_pixels|float / -1.0|Anchor error (-1 uses global settings)|

|groove_break_out_of_range_pixels|float / -1.0|Anchor position out of groove range (-1 uses global settings)|

|groove_break_end_pull_speed|float / -1.0|Relative speed pulling outward at end (-1 uses global settings)|

|groove_end_epsilon_pixels|float / -1.0|Allowance for end judgment (-1 uses global settings)|

|groove_break_stretch_ratio|float / -1.0|Stretch ratio relative to initial distance (-1 uses global settings)|

|groove_break_stretch_duration_sec|float / -1.0|Break if stretched for this many seconds or more (-1 uses global settings)|

|groove_stretch_threshold_ratio|float / -1.0|Stretch judgment threshold (-1 uses global settings)|

|groove_break_angle_degrees|float / -1.0|Break after a certain time if angle exceeds this value (-1 means disabled)|

|groove_break_angle_duration_sec|float / 0.5|Break if angle exceeds for this many seconds or more|


6-7. AreaJointBreaker2D

AreaJointBreaker2D is a utility that executes as a “separate object” and bulk severs Joint2Ds within the specified Area2D (CollisionShape2D) range.

Features

  • If BreakableJointMonitor2D exists, use monitor.break_joint() (Recommended)

  • If no monitor exists, delete directly via joint.queue_free()

  • Supported shapes: CircleShape2D, RectangleShape2D, CapsuleShape2D

Prerequisites and Requirements

  • Area2D must be set to target_area

  • CollisionShape2D must be a child of Area2D

Properties List

|Property|Type / Default|Description|

| — | — | — |

|enabled|bool / true|Enabled/Disabled|

|monitor|BreakableJointMonitor2D / null|Reference to BreakableJointMonitor2D (Optional)|

|search_root|Node / null|Root to scan (if not set, entire scene)|

|target_area|Area2D / null|Area2D to use as cutting range|

|target_collision_shape|CollisionShape2D / null|CollisionShape2D to use for range judgment (auto-search if not set)|

|include_pin_joint|bool / true|Include PinJoint2D as target|

|include_groove_joint|bool / true|Include GrooveJoint2D as target|

|include_other_joint2d|bool / true|Include other Joint2Ds as target|

|break_reason|String / "area_break"|Break reason (passed if monitor exists)|

|max_break_per_call|int / 0|Limit of breaks per execution (0 means unlimited)|

|_break_now_button|bool / false|Button execution in editor|

Public Methods

  • break_joints_in_target_area(): Sever Joint2Ds within the target_area range

6-8. RigidBodyPusherNatural

RigidBodyPusherNatural is a Node script that executes after the parent CharacterBody2D’s move_and_slide() and naturally pushes contacted RigidBody2Ds.

Features

  • Option to push only when parent moves

  • Choice between force method/impulse method

  • Mass-aware pushing

  • Combination of normal direction and movement direction

Prerequisites and Requirements

  • Parent node must be CharacterBody2D

  • move_and_slide() must be called

Properties List

|Property|Type / Default|Description|

| — | — | — |

|pusher_physics_priority|int / 1000|Physics processing priority (higher means later)|

|require_owner_motion|bool / false|Push only when parent moves|

|min_owner_position_delta_pixels|float / 0.01|Do not push if parent’s actual movement in one frame is less than this|

|min_owner_real_speed|float / 0.1|Do not push if parent’s actual speed is less than this|

|use_force|bool / true|Force method (force recommended for per-frame use)|

|push_strength|float / 100.0|Push strength coefficient|

|min_push_force|float / 50.0|Minimum push force|

|max_force|float / 200000.0|Force upper limit (if use_force=true)|

|max_impulse|float / 5000.0|Impulse upper limit (if use_force=false)|

|consider_mass|bool / true|Consider mass|

|mass_influence|float / 0.5|Mass influence (0.0-1.0)|

|normal_direction_weight|float / 0.7|Weight of force in collision normal direction (0.0-1.0)|

|movement_direction_weight|float / 0.3|Weight of force in movement direction (0.0-1.0)|

|wake_rigid_bodies|bool / true|Wake up RigidBody2D|


7. Usage Examples

7-1. Basic Chain Creation

  1. Place Node2D in scene (ChainRoot)

  2. Place multiple RigidBody2Ds as children (Link1, Link2, Link3…)

  3. Place ChainJointSetupTool as parent of ChainRoot

  4. Set target_parent to ChainRoot

  5. Check _setup_button

  6. Joints and seg nodes are automatically generated

7-2. Automatic Joint Severing

  1. Place BreakableJointMonitor2D in scene

  2. Set search_root to chain root

  3. Set break conditions like break_relative_speed=500.0

  4. On execution, joints meeting conditions are automatically severed

7-3. Chain Visualization

  1. Place ChainPathBinder2D in scene

  2. Set auto_detect_mode=true

  3. Set search_root to chain root

  4. Set joint_monitor to BreakableJointMonitor2D

  5. Place PathRibbonMesh2D and set path_nodes to ChainPathBinder2D’s output_paths

  6. On execution, chain shape is visualized and automatically split upon breakage

7-4. Pushing Boxes with CharacterBody2D

  1. Add Node as child of CharacterBody2D

  2. Attach rigid_body_pusher.gd

  3. Adjust push strength like push_strength=100.0

  4. On execution, CharacterBody2D naturally pushes contacted RigidBody2Ds

7-5. Bulk Severing Joints Within Area2D Range

  1. Prepare Area2D for cutting range and add CollisionShape2D as child

  2. Attach area_joint_breaker.gd to any node

  3. Set the above Area2D to target_area

  4. Set BreakableJointMonitor2D to monitor (Optional)

  5. Call break_joints_in_target_area()

  6. Joints within range are bulk severed


This is the usage guide for the Joint Chain Rope System.

1 Like