Skill Game Dev →

Y Sort Implementation

Implement Y-axis depth sorting in Unity 6 2D isometric scenes Custom Axis (0,1,0)…

A deterministic solution to the 'who's in front, who's behind' problem in Unity 6 2D isometric scenes: the root cause of roughly 80% of depth-sorting regressions where a character renders on top of a tree, clips through a wall, or an NPC 'floats' over a hill. It standardizes the Custom Axis (0,1,0) pattern, the pivot-on-base convention and a runtime tie-break so sprites never flicker and every scene loads in the same render order.

$15 one-time
Add to a kit →

Prices include 20% VAT. · Forged on real agency work · one-time, no lock-in

  • Type Skill
  • Category Game Dev
  • Delivery Email · instant
  • License One-time
Run preview
forgehouse, y-sort-implementation

Inside the run · no black box

See the actual work before you buy it.

Roughly 80 percent of isometric render bugs are sorting bugs. This setup makes the question of who renders in front deterministic: one axis, one pivot rule, one formula, and validators that reject any drift.

  1. Switches the project to Custom Axis sorting (0, 1, 0) in Graphics Settings and the URP 2D Renderer Data, so Unity orders every SpriteRenderer by its Y position: lower Y renders in front, matching the player's real-world intuition. An editor validator fail-fasts at load if either setting drifts back to Default.
  2. Enforces the pivot-on-base invariant: every sprite pivot must be bottom-center (0.5, 0). A YSortPivotValidator AssetPostprocessor sets it automatically on import and loudly rejects any asset whose pivot drifted, because a mid-body pivot makes the character sort from its torso instead of its feet.
  3. Routes all sortingOrder writes through one formula as single source of truth: floor(y * -100) plus a tieBreakBias plus instanceId masked to 8 bits. Two sprites on the exact same Y never flicker because the tie-break is deterministic, never random.
  4. Covers the exceptions with a CustomSortPoint component: flying objects like drones get a pseudo-base offset but still obey the same formula contract, and semantic bias slots (player +10, NPC 0, prop -10) decide who wins identical Y values.
  5. Pairs Y-sort with Pixel Perfect rendering: a PixelSnap component rounds positions to the PPU grid in LateUpdate, after Cinemachine has moved the camera, killing the sub-pixel jitter that makes followed characters shimmer.
  6. Verifies end to end: a test scene with 3 characters, 3 trees and a wall walked bottom-to-top must sort correctly, a dev-build runtime monitor counts pivot violations live, and a grep confirms sortingOrder is only written from the formula and the component, nowhere else.
Use cases · what happens when you plug it in

One power source. 6 lines out.

y-sort-implementation · core

core active · 6 lines

  1. Validating pivot and sorting when adding a new character or prop

    ✓ validating pivot and sor…
  2. Diagnosing 'character appears on top of the tree' bugs

    ✓ diagnosing 'character ap…
  3. Fixing jittery render under a Cinemachine follow camera

    ✓ fixing jittery render un…
  4. Recovering correct z-order after a scene refactor

    ✓ recovering correct z-order
  5. Normalizing pivot drift across Animator states

    ✓ normalizing pivot drift
  6. Enforcing Transparency Sort Mode at editor time

    ✓ enforcing transparency s…
Benefits · what you walk away with

Yours to keep.

Drag time forward. Watch what stays.

Forever

That's what owning means.

The rented stack

ai writing tool: subscription

expired · access lost

analytics suite: subscription

expired · access lost

design platform: subscription

expired · access lost

(nothing left)

Your forge

  1. Deterministic tie-break formula means two sprites at the same Y never flicker, and render order is identical every scene load

    license: perpetual
  2. Editor-time pivot enforcement catches drift at import instead of after hours of runtime debugging

    license: perpetual
  3. Pixel-snap discipline kills the sub-pixel jitter that breaks immersion under Cinemachine follow

    license: perpetual
  4. Single source of truth for sortingOrder keeps batching intact and draw calls low

    license: perpetual

subscriptions expire · deeds don't

What's included · the full manifest

Everything in the box.

Pick a piece up. Watch it work.

Custom Axis (0,1,0) setup with editor-load invariant validator

part 01 of 06 · in the box

6 parts · one working system · ships instantly by email

Who it's for

This wasn't forged for everyone.

  • Not for you if you'd rather rent a tool than own one.
  • Not for you if you want someone else to run your stack.
  • Not for you if you're happy guessing.
Still here? Good.

Unity 6 developers building 2.5D isometric games who need depth sorting to be deterministic, flicker-free and immersion-proof.

then this was forged for you.

Works with

Universal by design: these run in any AI. Delivered in the open Agent Skills + MCP format (native in Claude); ChatGPT, Gemini, Cursor and Copilot adapt the same files their own way.

  • Claude Native format
  • ChatGPT Adapts via open standards
  • Gemini Adapts via open standards
  • Cursor Adapts via open standards
  • Copilot Adapts via open standards
Questions · still in the air

Catch what's on your mind.

the air is clear. nothing between you and the forge.
catch a spark: the forge will answer

  1. My characters sometimes render behind trees they should be in front of, is that exactly what this fixes?

    Yes, that is the target problem. It standardizes Custom Axis (0,1,0) transparency sorting, the pivot-on-base (0.5, 0) convention and a deterministic tie-break, which together address the depth-sorting regressions behind 'character on top of the tree' and wall-clipping bugs in Unity 6 isometric scenes.

  2. Why does it need a tie-break formula, doesn't Unity sort by Y already?

    When two sprites share the same Y, Unity's order between them is undefined, so they can swap each frame and flicker. The single-source YSortFormula.Calculate with an instanceId fallback makes that order deterministic across frames and scene loads, and editor-time pivot enforcement catches drift before it ever reaches runtime.

  3. Will it solve sorting in my 3D or top-down non-isometric game too?

    No. It is scoped to Unity 6 2D isometric scenes using sprite-based transparency sorting. 3D depth buffers or genres that do not sort sprites by a Y axis fall outside the pattern; the components and validators assume the 2D isometric setup.

  4. How is it delivered?

    By email right after purchase: ready to run, downloaded instantly, no setup wait.

  5. One-time or subscription?

    A one-time purchase; no subscription or hidden fees. VAT (20%) is included.

  6. Can I get a refund?

    As a digital product, it can’t be refunded once downloaded. That’s why we show exactly what’s inside and who it’s for, right here.