A robust, high-performance Verlet integration rope system. Features two-way rigidbody coupling, dynamic meshing, self-collision, and a full runtime API.Bring realistic physics to your game with the Advanced Verlet Rope System. Whether you are building a grappling hook mechanic, a physics-based puzzle, or simply need decorative hanging cables, this package provides a stable and performant solution based on Verlet Integration.Unlike simple joint chains, this system simulates soft-body dynamics, allowing ropes to stretch, slack, and interact naturally with the environment. It comes with a powerful Two-Way Coupling feature: ropes don't just follow objects; they physically pull and interact with Rigidbodies based on mass and force settings.🔥 Key FeaturesRobust Verlet Physics: fast and stable simulation that handles gravity, air friction, and stiffness constraints without jitter.Bi-Directional Coupling: Connect ropes to Rigidbodies. Heavy objects pull the rope, and the rope can pull objects back. Perfect for cranes, winches, or character swinging.Dynamic Procedural Mesh: Generates smooth 3D meshes at runtime. Fully customizable radial segments (resolution), radius, and texture tiling.Advanced Collision Detection:Standard Colliders: Works with MeshColliders (convex/non-convex), Box, Sphere, and Capsule colliders.Terrain Support: Efficiently handles collisions with Unity Terrain.Self-Collision: Optional support for ropes colliding with themselves.Runtime Manipulation (API):Spawning: Create ropes dynamically using the RopeController.Connections: Branch ropes by connecting them to other ropes, transforms, or rigidbodies at runtime.Cutting/Resizing: Extend or shorten ropes, or cut them at specific nodes dynamically.Custom Raycasting: Includes a dedicated high-performance Raycast system (VerletPhysics.Raycast) to detect hits on thin procedural rope meshes accurately.🛠️ How It WorksSimply add the VerletRopeGenerator component to an object, set your start and end points, and hit play. The system automatically handles the mesh generation and physics constraints. You can pin nodes to static or moving objects to create complex physical contraptions.📦 Use CasesGrappling Hooks & Swinging MechanicsPhysics Puzzles (Pulling bridges, levers)Industrial Simulations (Cables, wires, hoses)Decorations (Hanging vines, chains, power lines)Technical DetailsSolver: Iterative Constraint Solver (Adjustable iterations for performance vs. quality balance).Rendering: Uses standard MeshRenderer (Compatible with Built-in, URP, and HDRP pipelines assuming standard materials are used).Source Code: Full C# source code included.Take full control of your physics simulations today with Advanced Verlet Rope!This package is built with performance and extensibility in mind.Core Physics Engine:Uses Explicit Verlet Integration for stable, energy-conserving simulation without the instability of standard spring joints.Iterative Constraint Solver: Stiffness is controlled via iteration counts (constraintIterations), allowing you to balance between absolute rigidity and CPU budget.Time Step Independence: Physics calculations are locked to FixedUpdate to ensure deterministic behavior across different frame rates.Collision System:Zero-Allocation Checks: Utilizes Physics.OverlapSphereNonAlloc to prevent garbage collection spikes during collision detection.Continuous Collision Detection (CCD): Implements Physics.SphereCast between previous and current node positions to prevent "tunneling" through thin objects at high velocities.Terrain Optimization: Features a dedicated, lightweight height-check (Terrain.SampleHeight) for performant ground interaction without mesh collider overhead.Procedural Rendering:Dynamic Mesh Update: Rope meshes are generated procedurally using a dedicated RopeMesh class. Vertex arrays are pre-allocated and updated in LateUpdate to ensure smooth visual interpolation after the physics step.Render Pipeline Agnostic: Since the system generates a standard Unity Mesh, it is fully compatible with Built-in, URP, and HDRP (dependent only on the Material you assign).Advanced Raycasting:Does not rely on MeshColliders for raycasting (which would be slow to update every frame).Includes a custom Analytic Raycast system (VerletPhysics.Raycast) that performs mathematical Ray-Segment intersection tests against the simulation nodes. This is significantly faster than updating a physics mesh every frame.Architecture:Coupling: Rigidbody interaction uses AddForceAtPosition for accurate torque generation on connected bodies.Centralized Manager: A static registry (VerletPhysics) keeps track of active ropes for global queries.




