원클릭으로
unity-physicscore2d-batching
Batching techniques for queries, projectiles/shooters, and swarm/flocking behaviors (boids)
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Batching techniques for queries, projectiles/shooters, and swarm/flocking behaviors (boids)
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | unity-physicscore2d-batching |
| description | Batching techniques for queries, projectiles/shooters, and swarm/flocking behaviors (boids) |
You are now acting as a Unity PhysicsCore2D batching expert, specialized in optimizing performance through batching techniques.
Batching operations in PhysicsCore2D significantly improves performance:
Reference examples from the PhysicsExamples2D repository:
Use PhysicsBody.CreateBatch instead of loops:
Example:
// Create 1000 bodies at once
var bodyDefinition = PhysicsBodyDefinition.defaultDefinition;
var bodies = PhysicsBody.CreateBatch(world, bodyDefinition, 1000, Allocator.Persistent);
// Dispose when done
PhysicsBody.DestroyBatch(bodies);
bodies.Dispose();
Create shapes for multiple bodies efficiently:
Perform many overlap tests efficiently:
Cast multiple rays in one operation:
Query multiple areas simultaneously:
Efficient projectile handling:
Shooter system pattern:
Update many projectiles together:
Simulate many agents efficiently:
Flocking behaviors:
Optimize neighbor searches:
Update many transforms at once:
Modify multiple bodies together:
Reuse physics bodies:
Parallelize operations:
Minimize allocations:
When users need information about:
All examples below assume the standard PhysicsCore2D
OnEnable/OnDisablelifecycle. See the umbrella skillunity-physicscore2d, section "Creating and Destroy Physics Objects", for the canonical lifecycle pattern.
PhysicsBody.SetBatchTransform/SetBatchVelocity to push every boid's new state to the engine in two batched calls.BatchCount raycasts run in IJobParallelFor, hits converted to a BatchForce array and applied via single PhysicsBody.SetBatchForce.world.CreateBodyBatch(definitions); on each step inspects world.contactBeginEvents and tears down hits via PhysicsBody.DestroyBatch.Collision detection, contact manifolds, collision responses, determinism, and character collision handling
Component authoring patterns and best practices for Unity PhysicsCore2D
High-level patterns and gameplay strategies for destructible objects in Unity PhysicsCore2D — slicing mechanics, fragmenting on impact, sprite-based destructible systems, debris cleanup, performance budgeting. Use for "how should I design destructible X?" questions. For the PhysicsDestructor type API and worked code examples see unity-physicscore2d-destructor; for raw member signatures see unity-physicscore2d-destructor-api.
Factory patterns for creating complex physics objects (ragdolls, soft bodies, vehicles, gears, mechanical systems)
Collision filtering, layer-based interactions, custom collision filters, and trigger areas
Environmental forces (wind), surface forces, and directional force application