One-click install
npx skills add https://github.com/BasarEkinci/memory-card-game --skill physics-basarekinci
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: physics
Source: https://github.com/BasarEkinci/memory-card-game/tree/main/.claude/skills/systems/physics
Command: npx skills add https://github.com/BasarEkinci/memory-card-game --skill physics-basarekinci

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid common Unity physics issues like inconsistent movement, GC allocations from physics queries, and unreliable collision handling by standardizing how physics code is written and configured.

Core Features & Use Cases

  • FixedUpdate Discipline: Keeps physics mutations inside FixedUpdate while inputs are read in Update to ensure predictable simulation.
  • Non-Allocating Queries: Uses NonAlloc variants (Raycast/Overlap/SphereCast/BoxCast/CapsuleCast) with preallocated buffers to reduce garbage collection spikes.
  • Collision & Trigger Control: Covers layer collision configuration, QueryTriggerInteraction, and correct Collision vs Trigger callback usage.
  • Performance & Correctness Patterns: Explains interpolation, collision detection modes, Physics.SyncTransforms, sleeping thresholds, and common configuration choices for player-like controllers and ragdoll transitions.
  • 2D and Joints Coverage: Includes 2D equivalents (Physics2D, Rigidbody2D, CompositeCollider2D, effectors) and joint selection guidance.

Quick Start

Ask the assistant: "Using the Unity 6 physics best practices in the physics skill, rewrite my controller so it reads input in Update, applies movement in FixedUpdate, replaces allocating physics queries with NonAlloc versions using cached buffers, and configures collision layers and QueryTriggerInteraction correctly."

Frequently Asked Questions about physics

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

FAQPage Schema
Why does my Unity character controller have inconsistent movement and physics simulation?

Unity physics garbage collection spikes are caused by allocating query variants like Raycast or SphereCast returning arrays. Using NonAlloc physics queries with preallocated buffers prevents GC allocations and eliminates performance regressions during gameplay.

How do I configure collision layers and trigger interactions correctly in Unity?

Correct Unity collision configuration requires setting up collision layers, using QueryTriggerInteraction appropriately, and distinguishing between Collision and Trigger callbacks. This ensures reliable collision detection and proper trigger handling for gameplay systems.

What are the best Rigidbody settings for stable Unity physics and ragdoll transitions?

Stable Unity physics requires appropriate Rigidbody interpolation, correct collision detection modes, and configured sleeping thresholds. These settings standardize player-like controllers and ensure smooth ragdoll switching without erratic behavior.

Does this Unity physics optimization approach work with 2D physics and joints?

Yes, Unity 2D physics optimization is covered through Physics2D, Rigidbody2D, CompositeCollider2D, and effectors. The approach includes 2D equivalents for queries and provides joint selection guidance for both 2D and 3D physics systems.

What is Physics.SyncTransforms and when do I need it for Unity physics queries?

Physics.SyncTransforms synchronizes transform changes with the physics engine before queries execute. It is needed when you modify transforms outside FixedUpdate and require immediate, accurate physics query results without waiting for the next simulation step.