unity-physicscore2d-settings

Configures PhysicsCoreSettings2D assets, layers, and world defaults for Unity PhysicsCore2D projects.

735|105|Updated Mar 4, 2017
One-click install
npx skills add https://github.com/Unity-Technologies/PhysicsExamples2D --skill unity-physicscore2d-settings
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-physicscore2d-settings
Source: https://github.com/Unity-Technologies/PhysicsExamples2D/tree/main/.claude/skills/unity-physicscore2d-settings
Command: npx skills add https://github.com/Unity-Technologies/PhysicsExamples2D --skill unity-physicscore2d-settings

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Setting up Unity's PhysicsCore2D configuration is error-prone: the PhysicsCoreSettings2D asset, 64-bit physics layers, collision matrices, and default body/world definitions must be created and assigned correctly, and many API property names (such as sleepingAllowed or simulationSubSteps) differ from older Physics2D conventions. This Skill provides verified guidance for configuring every section of the settings asset and accessing it from C# code.

Core Features & Use Cases

  • Settings Asset Setup: Step-by-step creation of the PhysicsCoreSettings2D ScriptableObject, assignment in Project Settings, and editing via Inspector or Project Settings.
  • Layer and Collision Matrix Configuration: Enable 64-bit PhysicsMask layers, name layers, and query masks at runtime with PhysicsLayers.GetLayerMask and GetLayerOrdinal.
  • Default Definitions and Runtime Access: Read physicsBodyDefinition and physicsWorldDefinition from the settings asset, or construct definitions with useSettings:true, then create worlds and bodies with tuned gravity, sub-steps, CCD, and debug drawing options.
  • Use Case: You are building a fast-paced 2D platformer and need high-accuracy simulation. Use this Skill to configure a PhysicsWorldDefinition with 3 simulation sub-steps, continuous collision, and tuned contact frequency, then create the world from those settings.

Quick Start

Ask the AI to show how to create and assign a PhysicsCoreSettings2D asset and configure a high-accuracy PhysicsWorldDefinition for your Unity 2D physics project.

Frequently Asked Questions about unity-physicscore2d-settings

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create and assign a PhysicsCoreSettings2D asset in Unity?

Create the asset via Assets > Create > 2D > PhysicsCore Settings 2D, then open Project Settings > PhysicsCore 2D and drag the asset into the settings field. You can then edit it in the Inspector or through Project Settings.

How do I set up 64-bit physics layers in Unity PhysicsCore2D?

Enable Use Full Layers in the PhysicsCoreSettings2D asset to activate the 64-bit PhysicsMask system with up to 64 named layers. At runtime, query masks with PhysicsLayers.GetLayerMask(string[]) and ordinals with PhysicsLayers.GetLayerOrdinal(string).

Does changing PhysicsCoreSettings2D defaults affect existing physics objects?

No, modifying default definitions only affects newly created objects. Changes take effect after restarting the Editor, re-entering Play mode, or creating new worlds and bodies from the updated definitions.

Why is my Unity 2D debug drawing not visible in builds?

Debug rendering is controlled by the renderingMode property on the settings asset, which defaults to EditorOnly. Set it to DevelopmentPlayer or AnyPlayer in the Inspector before building, then check PhysicsWorld.isRenderingAllowed at runtime.

How do I change gravity for a PhysicsWorld at runtime?

Set the gravity property directly on a live PhysicsWorld instance, such as PhysicsWorld.defaultWorld.gravity = new Vector2(0f, -4f). Alternatively, define gravity in a PhysicsWorldDefinition before calling PhysicsWorld.Create.