Learn how to grab, drag, and release objects with the mouse in Godot 4 using a clean and beginner-friendly script. In this video, we walk through a simple CharacterBody2D grabbing system that uses _input(), _process(), and lerp() to smoothly move an object toward the mouse cursor while holding the left mouse button.
This tutorial is perfect for beginners wanting to build:
✔ Drag-and-drop items
✔ Simple point-and-move interactions
✔ Inventory pickups
✔ 2D puzzle mechanics
✔ Mouse-controlled objects in Godot 4.x
🎮 What You’ll Learn
How to detect mouse input using InputEventMouseButton
How to toggle object grabbing with a simple boolean (is_grabbed)
How to smoothly drag objects using lerp()
⏱ Timestamps
0:00 Intro
0:18 Setting up Scene
1:04 How grabbing works
2:00 Coding the grabbing mechanic
5:26 Examples of Grab Drop Mechanic
👍 If this helped you:
Like, subscribe, and comment what feature you want next!
Want a physics-based grab system or Area2D detection version? Just ask!
How to update object position every frame inside _process()
Tips for expanding this into a full pickup or physics-based system