All skills
thedivergentai avatar

/godot-2d-physics

@9d6e91e

Expert patterns for Godot 2D physics including collision layers/masks, Area2D triggers, raycasting, and PhysicsDirectSpaceState2D queries. Use when implementing collision detection, trigger zones, line-of-sight systems, or manual physics queries. Trigger keywords: CollisionShape2D, CollisionPolygon2D, collision_layer, collision_mask, set_collision_layer_value, set_collision_mask_value, Area2D, body_entered, body_exited, RayCast2D, force_raycast_update, PhysicsPointQueryParameters2D, PhysicsShapeQueryParameters2D, direct_space_state, move_and_collide, move_and_slide.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-2d-physics

This session only. Nothing lands on disk.

referencesmigration-notes.md

≈825 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Migration notes: godot-2d-physics

Incremental upgrade for topics this skill covers. Apply one hop, stabilize/test, then next. Never skip hops.

If the project is < 4.0, follow godot-version-migration era bridges (legacy → 3→4) until 4.0, then these hops. Official 3→4: Upgrading from Godot 3 to Godot 4.

3.x → 4.0

Official: Upgrading from Godot 3 to Godot 4

  • KinematicBody2D → CharacterBody2D; move/move_and_slide APIs changed — rewrite character controllers.
  • RigidBody2D / Area2D signal and layer naming unchanged in spirit but audit body_entered vs legacy enter signals from 2.x leftovers.
  • RectangleShape2D.extents → size (full size, not half-extents).
  • Bullet was never 2D-default; still re-test after 3→4 converter renames.

4.0 → 4.1

Official: Upgrading to Godot 4.1

  • Area2D.priority type is int (was float) — audit serialized scenes and comparisons that stored fractional priorities.
  • PhysicsDirectSpaceState2D.collide_shape() return type changed to Array[Vector2] (was Array[PackedVector2Array]) — update shape-overlap snippets that iterated nested arrays.
  • Viewports with physics picking enabled now auto-mark InputEvents handled — remove redundant manual pick forwarding in ray/shape query tutorials.
  • PathFollow2D.lookahead removed — replace path-following samples with current PathFollow2D progress/rotation APIs.

4.1 → 4.2

Official: Upgrading to Godot 4.2

No skill-relevant breaking changes for this hop.

4.2 → 4.3

Official: Upgrading to Godot 4.3

No skill-relevant breaking changes for this hop.

4.3 → 4.4

Official: Upgrading to Godot 4.4

No skill-relevant breaking changes for this hop.

4.4 → 4.5

Official: Upgrading to Godot 4.5

No skill-relevant breaking changes for this hop.

4.5 → 4.6

Official: Upgrading to Godot 4.6

No skill-relevant breaking changes for this hop.

4.6 → 4.7

Official: Upgrading to Godot 4.7

  • PhysicsServer2D.body_set_shape_as_one_way_collision() adds optional direction relative to the shape — pass the platform normal (e.g. Vector2.UP.rotated(shape_rotation)) instead of assuming global up.
  • CollisionShape2D one-way collision direction is shape-relative — re-test tile and StaticBody one-way platforms after upgrade; rotate the shape or set direction explicitly for angled one-ways.

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides expert patterns for Godot 2D physics, including collision layers, raycasting, and performance optimization. No malicious patterns, obfuscation, or unauthorized data access were detected. All external links point to official Godot documentation or the verified author's GitHub repository.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    5/6 files flagged

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-2d-physics