Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

PixelPerfectSmoother

An asset by [email protected]
The page banner background of a mountain and forest
PixelPerfectSmoother hero image

Quick Information

0 ratings
PixelPerfectSmoother icon image
PixelPerfectSmoother

Pixel-perfect Camera2D smoothing for Godot 4.x pixel art games.Godot's built-in Camera2D position smoothing rounds to whole pixels after interpolating, discarding the sub-pixel remainder every frame. The result is a jitter artifact: the camera snaps instead of glides, and sprite edges visibly crawl during movement.This script replaces the engine smoothing entirely. It tracks a high-precision float position separately, interpolates it each frame, and only snaps to the nearest pixel grid point at the final render step — preserving smooth motion in logic while keeping crisp pixels on screen.Features:- Configurable follow speed and pixel size via Inspector- Pixel grid snapping (toggle on/off)- Static world-space base offset- World boundary clamping- snap_to_target() and set_follow_target() public API- Zero dependencies — works in a blank projectDrop PixelPerfectSmoother.gd onto your Camera2D. Set follow_target to your player node. Done.Godot 4.x only. GDScript 2.0.Extended version with velocity-based lookahead available at nullstateassets.itch.io.

Supported Engine Version
4.0
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
2 days ago
Git URL
Issue URL

PixelPerfectSmoother — Lite

Stop fighting your engine. Ship faster.


The Problem

Camera2D smoothing is jittery with pixel art.

Godot's built-in position smoothing rounds to whole pixels after interpolating, discarding the sub-pixel remainder every frame. The result: the camera snaps instead of glides, and sprite edges crawl during movement. There is no clean built-in fix.


The Solution

Drop script.gd onto your Camera2D node. It replaces the engine's smoothing with a high-precision float position that is tracked separately, smoothed independently, and only snapped to the pixel grid at the final render step.

No plugins. No autoloads. One file.


What's in the Lite Version

  • Sub-pixel accurate position tracking and smoothing
  • Configurable follow speed and pixel size via Inspector
  • Pixel grid snapping (toggle on/off)
  • Static world-space offset (base_offset)
  • World boundary clamping
  • snap_to_target() and set_follow_target() public API

What's in the Full Version

The full version adds velocity-based lookahead: the camera reads your CharacterBody2D's velocity and shifts ahead of movement direction, giving a cinematic anticipation feel. Two exports control strength and smoothing independently so you can dial in the exact camera personality your game needs.

Full version on itch.io: https://nullstateassets.itch.io


Quick Start

  1. Copy script.gd into your Godot project.
  2. Attach it to your Camera2D node (replaces it — Camera2D is the base class).
  3. Set follow_target to your player node in the Inspector.
  4. Hit Play.

Compatibility

Engine Language Tested On
Godot 4.x GDScript 4.2, 4.3

License

MIT License. Free for personal and commercial use. Attribution appreciated but not required.

Pixel-perfect Camera2D smoothing for Godot 4.x pixel art games.

Godot's built-in Camera2D position smoothing rounds to whole pixels after interpolating, discarding the sub-pixel remainder every frame. The result is a jitter artifact: the camera snaps instead of glides, and sprite edges visibly crawl during movement.

This script replaces the engine smoothing entirely. It tracks a high-precision float position separately, interpolates it each frame, and only snaps to the nearest pixel grid point at the final render step — preserving smooth motion in logic while keeping crisp pixels on screen.

Features:
- Configurable follow speed and pixel size via Inspector
- Pixel grid snapping (toggle on/off)
- Static world-space base offset
- World boundary clamping
- snap_to_target() and set_follow_target() public API
- Zero dependencies — works in a blank project

Drop PixelPerfectSmoother.gd onto your Camera2D. Set follow_target to your player node. Done.

Godot 4.x only. GDScript 2.0.

Extended version with velocity-based lookahead available at nullstateassets.itch.io.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
PixelPerfectSmoother icon image
PixelPerfectSmoother

Pixel-perfect Camera2D smoothing for Godot 4.x pixel art games.Godot's built-in Camera2D position smoothing rounds to whole pixels after interpolating, discarding the sub-pixel remainder every frame. The result is a jitter artifact: the camera snaps instead of glides, and sprite edges visibly crawl during movement.This script replaces the engine smoothing entirely. It tracks a high-precision float position separately, interpolates it each frame, and only snaps to the nearest pixel grid point at the final render step — preserving smooth motion in logic while keeping crisp pixels on screen.Features:- Configurable follow speed and pixel size via Inspector- Pixel grid snapping (toggle on/off)- Static world-space base offset- World boundary clamping- snap_to_target() and set_follow_target() public API- Zero dependencies — works in a blank projectDrop PixelPerfectSmoother.gd onto your Camera2D. Set follow_target to your player node. Done.Godot 4.x only. GDScript 2.0.Extended version with velocity-based lookahead available at nullstateassets.itch.io.

Supported Engine Version
4.0
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
2 days ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers