원클릭으로
unity-physicscore2d-components
Component authoring patterns and best practices for Unity PhysicsCore2D
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Component authoring patterns and best practices for Unity PhysicsCore2D
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Batching techniques for queries, projectiles/shooters, and swarm/flocking behaviors (boids)
Collision detection, contact manifolds, collision responses, determinism, and character collision handling
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
| name | unity-physicscore2d-components |
| description | Component authoring patterns and best practices for Unity PhysicsCore2D |
This sub-skill provides detailed information about authoring Unity components that wrap PhysicsCore2D objects.
The PhysicsCore2D is an API that is decoupled from Unity GameObject and Components however it is designed to be used in two ways:
To make component authoring easier, the API has many features which make this easier such as:
A complete example package is available which wraps all the available physics objects into Unity components, all of which demonstrate the above features. The package can be found here: https://github.com/Unity-Technologies/PhysicsExamples2D/tree/master/Packages/com.unity.2d.physics.extras The package runtime directory contains all the Unity components available. All the example components begin with the prefix "Scene" i.e. SceneWorld, SceneBody, SceneShape etc.
The debug drawing refers to the PhysicsWorld renderer which will automatically draw the world contents (PhysicsBody, PhysicsShape, PhysicsJoint etc). The user can also explicitly ask for custom drawing on any PhysicsWorld to draw any geometry type, lines, line-strips, points, capsules, circles, boxes etc.
To control what is drawn in the world, use the world.drawOptions property (get/set). This property accepts an enumeration of things that should be drawn.
You can find the API reference for drawOptions here: https://docs.unity3d.com/6000.5/Documentation/ScriptReference/Unity.U2D.Physics.PhysicsWorld-drawOptions.html
Best Practice: Individual components should NOT modify world.drawOptions as this is a global world-level setting. The user controls what is drawn at the world/scene level. If a component wants to conditionally draw something (like a circle, line, etc.), it should use a local boolean field (e.g., public bool DrawCircle = true) to control whether that specific component draws, not modify the global world settings.
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.