Skip to content

Instantly share code, notes, and snippets.

View MrSmiler's full-sized avatar
🎯
Focusing

MrSmiler

🎯
Focusing
View GitHub Profile
@thygrrr
thygrrr / CameraZoomAndPan.gd
Last active February 18, 2025 18:38
Godot Zoom and Pan, smooth & cursor-centric Camera2D motion
# SPDX-License-Identifier: Unlicense or CC0
extends Node2D
# Smooth panning and precise zooming for Camera2D
# Usage: This script may be placed on a child node
# of a Camera2D or on a Camera2D itself.
# Suggestion: Change and/or set up the three Input Actions,
# otherwise the mouse will fall back to hard-wired mouse
# buttons and you will miss out on alternative bindings,
# deadzones, and other nice things from the project InputMap.