NilDev Directional Movement 2D's icon

NilDev Directional Movement 2D 1.0 2D Tools 4.4 Community

Submitted by user NilDev; MIT; 2026-03-16

NilDev Directional Movement 2D is a lightweight input abstraction layer for Godot 4 that unifies directional movement across keyboard, mouse, and touch controls.

The library interprets player intent and returns a normalized movement vector that can be applied to any movement system (for example CharacterBody2D velocity or custom physics).

Unlike typical movement scripts, this addon separates input handling from movement logic and supports multiple input methods automatically. This makes it useful for cross-platform projects targeting desktop and mobile devices.

Features:
• Keyboard directional input (InputMap based)
• Mouse directional movement
• Touch / virtual joystick style movement
• Deadzone handling
• Configurable maximum movement radius
• Motion timeout support
• Automatic input source prioritization (touch > mouse > keyboard)
• Lightweight and engine-agnostic design

The addon does not replace Godot's physics or movement systems. Instead, it provides a clean directional vector that can be applied to any gameplay system.

Example usage:

var direction = movement.calculate_movement(player_position)
velocity = direction * speed
move_and_slide()

This addon is designed for top-down movement systems, mobile-friendly games, and projects that require consistent directional input across multiple platforms.


View files Download Submit an issue Recent Edits