What problem does it solve?
Working with Unity's PhysicsCore2D API requires choosing correct body types, configuring mass and sleep behavior, and avoiding the common WORM concurrency crash when mutating bodies during simulation callbacks. This Skill provides the patterns and code examples to handle PhysicsBody lifecycle correctly.
Core Features & Use Cases
- Body Type Selection: Guidance on Static, Kinematic, and Dynamic bodies, including collision behavior between types and when to use each.
- Mass and Shape Configuration: Automatic density-based mass, batched shape creation with deferred mass updates, and manual mass/inertia/center-of-mass overrides.
- Lifecycle Safety: Owner key patterns, sleep management, transform sync to GameObjects, and the WORM rule for safely creating or destroying bodies around simulation callbacks.
- Use Case: A developer building a 2D platformer uses this Skill to create a dynamic character body with FreezeRotation, lowered center of mass, and deferred bullet destruction inside contact callbacks.
Quick Start
Ask the AI to create a dynamic PhysicsBody in Unity PhysicsCore2D with a circle shape, frozen rotation, and safe destruction on collision.