Skip to content

Instantly share code, notes, and snippets.

View Lakamfo's full-sized avatar
🏠
Working from home

Danila Lakamfo

🏠
Working from home
View GitHub Profile
@Lakamfo
Lakamfo / ActionMobileButton.gd
Created September 29, 2025 14:09
Godot 4.x. Touch control script: attaches to any Control node and triggers a specified Input shortcut when pressed. Useful for implementing custom buttons without relying on a virtual joystick.
extends Control
class_name ActionMobileButton
@export var show_only_with_touch : bool = true
@export var action: String
@export var toggle_button : bool = false
@export var pressed_modulate: Color = Color.DARK_GRAY
var toggled : bool = false