physics-2d

Adds Rapier-based 2D rigid body physics, colliders, and character controllers to ignifx games.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/astrum-forge/ignifx --skill physics-2d-astrum-forge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: physics-2d
Source: https://github.com/astrum-forge/ignifx/tree/main/packages/physics-2d/skills/physics-2d
Command: npx skills add https://github.com/astrum-forge/ignifx --skill physics-2d-astrum-forge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @dimforge/rapier2d-compat, @ignifx/core.

What problem does it solve? Adding realistic 2D physics to an ignifx game requires wiring up rigid bodies, colliders, collision filtering, and platformer movement by hand. This Skill provides the complete operational knowledge for the @ignifx/physics-2d extension so an AI agent can correctly configure Rapier 2D simulation, colliders, triggers, and character controllers without guesswork. ## Core Features & Use Cases - Rigid Bodies & Colliders: Configure Rigidbody2D with box, circle, capsule, polygon, edge, and tilemap colliders, physics materials, and collision layer filtering. - CharacterController2D: Build platformer movement with slopes, autostep, snap-to-ground, and one-way platforms driven from fixedUpdate. - Queries & Triggers: Perform 2D raycasts, shape casts, and overlap queries, and handle trigger zones via onTriggerEnter/onTriggerExit callbacks. - Use Case: Ask the agent to add a falling crate, a coin pickup trigger, or a tilemap-based level with solid collision to your ignifx 2D game, and it will produce correct, engine-idiomatic code. ## Quick Start Ask the agent to add 2D physics to your ignifx project by registering physics2d() and creating a floor with a BoxCollider2D plus a falling dynamic Rigidbody2D crate.

Frequently Asked Questions about physics-2d

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

FAQPage Schema
How do I add 2D physics to an ignifx game?

Register the physics2d() extension when creating the app, then add a collider such as BoxCollider2D to make an entity solid and a Rigidbody2D to make it move. The simulation runs on the engine's fixed loop in metres and seconds.

How do I build platformer movement with CharacterController2D?

Add a CharacterController2D component and call controller.move(delta) from fixedUpdate each step. The controller is purely kinematic, so your script owns gravity, jump velocity, and coyote time; read isGrounded and groundNormal for state.

Does @ignifx/physics-2d work in browsers, Node, and Electron?

Yes. It depends on @dimforge/rapier2d-compat, which inlines its WebAssembly as base64, so Node, browsers, and Electron all take the same path with nothing extra to serve. It also runs headless with no GPU.

Why does my 2D raycast throw an error in ignifx?

Physics queries need one completed simulation step because Rapier builds its broadphase inside step. Call app.step(1/60) once before calling app.physics2d.raycast, otherwise the query throws error IGX-1153.

What are the limitations of PolygonCollider2D and EdgeCollider2D?

PolygonCollider2D builds the convex hull of its points, so concave outlines are silently filled in; use multiple polygons instead. EdgeCollider2D is infinitely thin, so fast bodies can tunnel through it and it suits only static level geometry.

Can a trigger collider block a CharacterController2D?

No. The character controller filters sensors out of its collide-and-slide sweep, so it passes through isTrigger colliders at full speed while onTriggerEnter and onTriggerExit still fire on both entities.