unity-physicscore2d-materials

Configures friction, bounciness, rolling resistance, and surface velocity for Unity PhysicsCore2D materials.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Working with Unity's newer PhysicsCore2D API (Unity.U2D.Physics) requires knowing how surface material properties like friction, restitution, rolling resistance, and tangent speed are defined and combined, which differs from the older Physics2D component API.

Core Features & Use Cases

  • Material Property Guidance: Explains friction, bounciness/restitution, rolling resistance, and surface velocity (tangentSpeed) as defined in PhysicsShapeDefinition and SurfaceMaterial.
  • Runnable C# Examples: Provides four worked examples (Friction, Bounciness, RollingResistance, ConveyorBelt) demonstrating parameter sweeps and runtime-tunable surface behavior.
  • Use Case: Build a conveyor belt by setting surfaceMaterial.tangentSpeed on a static body so resting objects are dragged along without moving the body itself, with speed and angle adjustable at runtime.

Quick Start

Ask the assistant to show how to create a conveyor belt or adjust friction and bounciness on a PhysicsCore2D shape using the Unity.U2D.Physics API.

Frequently Asked Questions about unity-physicscore2d-materials

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

FAQPage Schema
How do I set friction and bounciness in Unity PhysicsCore2D?

Set friction and bounciness through the surfaceMaterial field of PhysicsShapeDefinition when creating a shape. Friction typically ranges from 0.0 to 1.0, and bounciness from 0.0 (no bounce) to 1.0 (perfectly elastic).

How do I make a conveyor belt with Unity.U2D.Physics?

Create a static body and set surfaceMaterial.tangentSpeed on its shape. The surface velocity drags resting objects along without moving the body itself, and you can update tangentSpeed at runtime by modifying the shape's surfaceMaterial struct.

What is rolling resistance in Unity 2D physics?

Rolling resistance is a surface material property that simulates energy loss during rolling, preventing objects from rolling indefinitely. Higher values cause balls and wheels to stop sooner, useful for realistic ball behavior.

How are material properties combined when two shapes collide?

When two shapes collide, their material properties are combined by the physics engine. Friction typically uses multiplication or the minimum of both values, while restitution typically uses the maximum of both values.

Why does my PhysicsCore2D simulation become unstable with high bounciness?

Restitution values above 0.9 can cause instability, and values above 1.0 add energy to the system on each collision. Keep restitution between 0.0 and 0.3 for most objects to maintain stable behavior.