unity-physicscore2d-collision

Detect 2D collision begin and end events via PhysicsCallbacks.IContactCallback in Unity PhysicsCore2D.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the challenge of reliably detecting 2D collisions in Unity's PhysicsCore2D, delivering precise contact manifolds, deterministic behavior, and structured collision callbacks for robust character movement and gameplay interactions.

Core Features & Use Cases

  • Contact callbacks via IContactCallback to handle begin/end of collisions.
  • Access to contact manifolds and per-point data (normal, points, impulses).
  • Useful for character controllers, projectiles, and interactive objects where collision timing matters.
  • Determinism and performance guidance.

Quick Start

Enable at least one shape's contactEvents and assign a callbackTarget to receive collision begin/end events after PhysicsWorld.Step.

Frequently Asked Questions about unity-physicscore2d-collision

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

FAQPage Schema
How do I detect 2D collisions in Unity PhysicsCore2D?

To detect 2D collisions in Unity PhysicsCore2D, you must implement the PhysicsCallbacks.IContactCallback interface and enable collision callbacks by setting shape.callbackTarget and PhysicsWorld.autoContactCallbacks to true.

What contact data is available from a PhysicsCore2D collision callback?

Collision callbacks in PhysicsCore2D provide access to detailed contact manifolds, including per-point data such as collision normals, contact points, and applied impulses.

Do I need a character controller to use PhysicsCore2D collision detection?

No, while PhysicsCore2D collision detection is primarily used for character movement, it is equally effective for handling projectiles and interactive objects.

What is the best way to ensure deterministic 2D collision handling in Unity?

The best way to ensure deterministic 2D collision handling is to use PhysicsCore2D with structured IContactCallback events, which deliver precise contact manifolds and reliable collision timing.

Why are my PhysicsCore2D contact callbacks not firing?

PhysicsCore2D contact callbacks will not fire if you have not enabled contactEvents on at least one shape and assigned a callbackTarget to receive the collision events.