What problem does it solve?
Designing destructible objects in Unity's PhysicsCore2D API requires choosing between slicing, fragmenting, sprite destruction, and pre-fractured approaches, each with different performance and gameplay trade-offs. This Skill provides high-level design guidance plus complete worked C# examples so you can pick and implement the right destruction pattern without starting from scratch.
Core Features & Use Cases
- Destruction Pattern Guidance: Compares slicing, fragmenting, sprite destruction, pre-fractured objects, and dynamic mesh splitting with implementation steps for each.
- Worked Code Examples: Includes three complete MonoBehaviour examples demonstrating PhysicsDestructor.Slice, PhysicsDestructor.Fragment with masks and seed points, and island-splitting with static/dynamic remainder classification.
- Performance & Gameplay Advice: Covers fragment pooling, debris cleanup, body-count budgeting, explosion impulses, and material-based break behavior.
- Use Case: You are building a top-down shooter where projectiles break walls into debris. Use the FragmentingPattern example to fragment a destructible body on contact, rebuild the unbroken remainder, spawn debris bodies via CreateBodyBatch, and apply an explosion impulse.
Quick Start
Ask the AI to design a destructible object system for your Unity PhysicsCore2D game, for example by requesting a fragmentation-on-impact pattern using PhysicsDestructor with debris cleanup.