unity-physicscore2d-chains-api

Provides the Unity 6000.5 PhysicsCore2D API reference for PhysicsChain and PhysicsChainDefinition types.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unity 6000.5's PhysicsCore2D API post-dates most AI training data, so code assistants often hallucinate member names or signatures when working with chain shapes. This Skill supplies the authoritative, auto-generated API surface for PhysicsChain and PhysicsChainDefinition so generated code compiles against the real API.

Core Features & Use Cases

  • Complete Member Listings: Every property and method for PhysicsChain and PhysicsChainDefinition, with full signatures, parameters, and return values.
  • Behavioral Documentation: Chain constraints such as minimum vertex counts, one-sided collision, loop vs open chains, and ghost vertex handling.
  • Use Case: When writing a Unity 6000.5 script that creates a chain collider from a vertex array, the assistant can reference exact signatures like PhysicsChain.Create(PhysicsBody, ReadOnlySpan<Vector2>, PhysicsChainDefinition) instead of guessing.

Quick Start

Ask the assistant to write Unity 6000.5 code that creates a looping PhysicsChain from a set of Vector2 vertices using the PhysicsCore2D API.

Frequently Asked Questions about unity-physicscore2d-chains-api

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

FAQPage Schema
How do I create a chain shape in Unity PhysicsCore2D?

Call PhysicsChain.Create with a PhysicsBody, either a ChainGeometry or a ReadOnlySpan of Vector2 vertices, and a PhysicsChainDefinition. The chain must have at least 4 points, and consecutive points must be separated by more than the linear slop distance.

What is the difference between PhysicsChain and PhysicsChainDefinition?

PhysicsChain is the runtime shape attached to a body that produces connected chain segments. PhysicsChainDefinition is the configuration struct specifying isLoop, contactFilter, surfaceMaterial, and triggerEvents used when creating the chain.

Does PhysicsChain support closed loops in Unity 6000.5?

Yes, set isLoop to true in PhysicsChainDefinition to form a closed chain connecting the first and last vertices. Loop chains calculate ghost vertices automatically, while open chains have no collision on their first and final edges.

Why does my PhysicsChain have ghost collisions on corners?

Chain shapes are specifically designed to avoid ghost collisions by providing a smooth continuous surface, unlike separate edge shapes. If artifacts appear, verify the chain does not self-intersect and that point spacing exceeds the minimum distance requirement.

Can I update PhysicsChain vertices after creation?

Yes, use UpdateVertices with a ReadOnlySpan of Vector2 and an isLoop flag. The vertex count and loop setting must match the original creation parameters, otherwise a warning is issued, and changes may cause overlaps or tunneling.