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)
-
Place a
Node2Din the scene (e.g.,ChainRoot) -
Place multiple
RigidBody2Dsas children (e.g.,Link1,Link2,Link3…) -
Add
CollisionShape2DandSprite2Dto each RigidBody2D -
Add a
Node2Das a child to each RigidBody2D and name themseg1,seg2, etc. (used as connection points)
Setup Steps (Automatic: Using ChainJointSetupTool)
-
Place a
Node2Din the scene -
Attach
chain_setup_tool.gd -
Set
target_parentto the parent node of the chain (if not set, uses this node’s parent) -
Check
_setup_buttonin the Inspector or callsetup_chain() -
Child RigidBody2Ds are automatically detected, and Joints and seg nodes are generated
In the Sample
- If
auto_setup_all=true,BreakableJointMonitor2D,ChainPathBinder2D,Path2D, andPathRibbonMesh2Dare 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
-
Place a
Nodein the scene -
Attach
breakable_joint_monitor_2d.gd -
Set
search_rootto the root node of the targets to monitor (if not set, uses the parent node) -
Set break conditions (e.g.,
break_relative_speed,pin_break_error_pixels, etc.) -
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)
-
Place a
Nodein the scene -
Attach
rope_solver.gd -
Set
source_mode:
-
NODEPATH_LIST: Explicitly specify node paths inpoint_node_paths -
CHILDREN_RECURSIVE: Auto-detect from descendants (specify type withchild_filter_mode)
-
Add
Path2Dtooutput_paths(auto-generated if empty) -
Updates automatically if
auto_update=true
Setup Steps (ChainPathBinder2D: For Chains)
-
Place a
Nodein the scene -
Attach
chain_path_binder.gd -
If
auto_detect_mode=true, RigidBody2Ds undersearch_rootare automatically detected -
Or manually add
ChainPartResourcetochain_parts -
If
joint_monitoris set toBreakableJointMonitor2D, paths are automatically split upon breakage -
Add
Path2Dtooutput_paths(auto-generated if empty)
In the Sample
- Updates in the physics frame with
auto_update=trueandupdate_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
-
Add a
Nodeas a child ofCharacterBody2D -
Attach
rigid_body_pusher.gd -
Set
pusher_physics_priority(set a larger value to execute aftermove_and_slide(), default: 1000) -
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
-
Prepare an
Area2Dfor the cutting range and add aCollisionShape2Das a child -
Attach
area_joint_breaker.gdto any node -
Set the above
Area2Dtotarget_area -
Set
BreakableJointMonitor2Dtomonitor(optional; if set, thejoint_brokensignal is emitted) -
Call
break_joints_in_target_area()
In the Sample
- Can be executed by checking
_break_now_buttonin the editor
2. Execution (How It Works)
2-1. Automatic Joint Severing
Processing Flow
-
BreakableJointMonitor2Dmonitors each joint in_physics_process -
If break conditions are met, it waits for
break_delay_frames(orbreak_delay_sec) -
If conditions persist, it severs the joint via
joint.queue_free()and emits thejoint_brokensignal -
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
-
RopePathBinder2DorChainPathBinder2Dcollects the node sequence in_physics_process -
Converts each node’s
global_positionto local coordinates forPath2D -
Clears
Curve2Dand adds the new point sequence -
Optionally applies resampling, smooth handles, and endpoint offsets
-
Emits the
paths_updatedsignal (used inPathRibbonMesh2D, etc.)
Automatic Splitting During Chain Breakage
-
ChainPathBinder2Dreceives thejoint_brokensignal -
Retrieves
body_aandbody_bof the severed joint -
Rebuilds the connection graph and detects connected components
-
Generates and updates
Path2Dfor each connected component
Operation in Sample
-
As the rope/chain moves physically,
Path2Dfollows to visualize the shape -
When a joint breaks, the path is automatically split
2-3. RigidBody2D Pushing
Processing Flow
-
RigidBodyPusherNaturalexecutes in_physics_process(execution order controlled bypusher_physics_priority) -
Retrieves collisions via the parent’s
CharacterBody2D.get_slide_collision_count() -
If the collision partner is a
RigidBody2D, calculates the push force -
Determines push direction by combining normal direction and movement direction
-
Applies force via
apply_central_force()orapply_central_impulse()
Operation in Sample
- When
CharacterBody2Dcontacts aRigidBody2Dlike 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_framesis too large -
search_rootis 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_pathsis empty -
Nodes are not collected (check
source_modeorsearch_rootsettings)
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=trueand parent is not moving -
min_push_forceis too small -
consider_mass=trueand 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
-
Select
BreakableJointMonitor2D -
Adjust break condition values:
-
To make more sensitive: Lower
break_relative_speed, setbreak_delay_framesto 1 -
To make more robust: Raise
break_relative_speed, increasebreak_delay_frames
- If individual settings are needed, add
JointBreakParamsresource tojoint_params
Example of Individual Settings
-
Create
JointBreakParamsas a resource -
Set the NodePath of the target joint to
joint_path -
Set individual break parameters (-1.0 uses global settings)
-
Add to
joint_paramsofBreakableJointMonitor2D
4-2. Adjusting Rope/Chain Appearance
Objective
Adjust path smoothness and point density.
Steps
-
Select
RopePathBinder2DorChainPathBinder2D -
Set
resample_spacing_pxto make point sequence uniform (e.g., 8.0) -
Set
enable_smooth_handles=trueto makeCurve2Dsmoother -
Set
min_point_distance_pxto thin out points that are too close
4-3. Increasing Chain Segments
Objective
Create a longer chain.
Steps
-
Add
RigidBody2Dunder the chain’s parent node -
Re-run
setup_chain()ofChainJointSetupTool -
Or manually add
GrooveJoint2D/PinJoint2D
4-4. Adjusting Push Strength
Objective
Change the strength with which CharacterBody2D pushes RigidBody2D.
Steps
-
Select
RigidBodyPusherNatural -
Adjust
push_strength(higher means stronger push) -
Adjust
min_push_force(to push boxes on the ground) -
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
PinJoint2DandGrooveJoint2Dundersearch_root -
Nodes included in
exclude_groupsare 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 -
Path2Dis added tooutput_pathsor 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 undersearch_rootare 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
@toolscript, 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
BreakableJointMonitor2Dexists, usemonitor.break_joint()(Recommended) -
If no monitor exists, delete directly via
joint.queue_free() -
Supported shapes: CircleShape2D, RectangleShape2D, CapsuleShape2D
Prerequisites and Requirements
-
Area2Dmust be set totarget_area -
CollisionShape2Dmust be a child ofArea2D
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
-
Place
Node2Din scene (ChainRoot) -
Place multiple
RigidBody2Dsas children (Link1,Link2,Link3…) -
Place
ChainJointSetupToolas parent ofChainRoot -
Set
target_parenttoChainRoot -
Check
_setup_button -
Joints and seg nodes are automatically generated
7-2. Automatic Joint Severing
-
Place
BreakableJointMonitor2Din scene -
Set
search_rootto chain root -
Set break conditions like
break_relative_speed=500.0 -
On execution, joints meeting conditions are automatically severed
7-3. Chain Visualization
-
Place
ChainPathBinder2Din scene -
Set
auto_detect_mode=true -
Set
search_rootto chain root -
Set
joint_monitortoBreakableJointMonitor2D -
Place
PathRibbonMesh2Dand setpath_nodestoChainPathBinder2D’soutput_paths -
On execution, chain shape is visualized and automatically split upon breakage
7-4. Pushing Boxes with CharacterBody2D
-
Add
Nodeas child ofCharacterBody2D -
Attach
rigid_body_pusher.gd -
Adjust push strength like
push_strength=100.0 -
On execution,
CharacterBody2Dnaturally pushes contactedRigidBody2Ds
7-5. Bulk Severing Joints Within Area2D Range
-
Prepare
Area2Dfor cutting range and addCollisionShape2Das child -
Attach
area_joint_breaker.gdto any node -
Set the above
Area2Dtotarget_area -
Set
BreakableJointMonitor2Dtomonitor(Optional) -
Call
break_joints_in_target_area() -
Joints within range are bulk severed
This is the usage guide for the Joint Chain Rope System.