How to make a drag and drop system in Godot 4

preview_player
Показать описание
How to make a customizable drag and drop system in Godot 4, for idle games or inventory and etc.

You can also find me on:

#godot #gamedev #godot4 #tutorial #quicktutorial
Рекомендации по теме
Комментарии
Автор

extends CharacterBody2D

var selected = false



func _on_area_2d_input_event(viewport, event, shape_idx):
if
selected = false
else:
selected = true

func _physics_process(delta):
if selected:
global_position = lerp(global_position, get_global_mouse_position(), 25 * delta)

AnnaGlin
Автор

would love a pastebin of your code in the description

bonsaipropaganda