PixelPerfectSmoother 1.0 Scripts 4.0 Community
Submitted by user [email protected]; MIT; 2026-03-02
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.
View files Download Submit an issue Recent Edits