What problem does it solve?
Physics simulations in Unity's PhysicsCore2D API can degrade quickly as body counts, joint networks, and collision pairs grow, causing long physics steps, memory spikes, and frame drops. This Skill provides expert guidance on capacity planning, benchmarking, and optimization so simulations stay within performance budgets.
Core Features & Use Cases
- Capacity Planning & Benchmarking: Measure body, shape, contact, and joint limits using world.profile.simulationStep and world.counters, with stress-test examples like CapacityTest and JointGrid.
- Optimization Techniques: Apply broad-phase tuning, shape simplification, sleep optimization, layer-based collision filtering, query batching, and joint reduction.
- Large-Scale Simulation Patterns: Implement world partitioning, LOD, streaming, culling, object pooling, and batch operations with NativeArray/NativeList to avoid GC pressure.
- Use Case: A developer building a mobile game with hundreds of dynamic debris bodies uses the CapacityTest pattern to find the maximum sustainable body count on target hardware, then applies layer filtering and sleeping to keep physics step time under 5ms.
Quick Start
Ask the assistant to help you benchmark and optimize your PhysicsCore2D scene, for example by reducing physics step time for a scene with thousands of dynamic bodies and joints.